Example value of ID is "12333-1arerd-2333d-rrrrrwwqq"
In the scripted field of the Index pattern i have given the below Script:
if (doc['TestID'] == null || doc['TestID'].isEmpty())
{
return "";
}
String res = doc['TestID'][0];
return res;
After created index and Inserted data, i could get only the part of the ID.
"TestID": [
"2333d"]
How to escape this hypen and pass the whole id value. Due to token i am getting it in terms.
The to get the whole field you would just access the TestID.keyword field which would have the whole string untokenized, that way you could do text search and still have the whole unaltered string.
Thanks for your reply and time.
Could you please let me know if there is any possiblity for getting the untokenzied value of the ID without changing the mapping from Text to Keyword.
As mentioned earlier, below is the script which i have tried in the Scriptted field:
if (doc['TestID'] == null || doc['TestID'].isEmpty()) {
return "";
}
String res = doc['TestID'][0];
return res;
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.