I want to create a scripted field in kibana . My requirement is to use words rather numbers . So I have a field Priority =1 to 10 here 1 is lowest and 10 is the highest . So it is like if priority in [1,5] then it is low or if priority in [6,10] then it should be high .
I tried this but it does not work
doc['priority'].value == 9 ? high : low
Rather doc['priority'].value == 9 ? 1 : 0 is working fine but it does not solve my problem as I do not want numeric output , Plus how I can mentions multiple conditions here ?
Lucene expressions (default scripting language) only work on numerical data, so you can't introduce strings. If you want to go this route, you have to use Groovy.
Lets assume I have a Groovy Script , my concern is where I need to call that I was searching for Groovy script in Elasticsearch , I saw some examples but those are again on numerical data . Can you suggest some simple example for string data.
Thanks It helps, need another favor . I am trying below code but it is not working . I wan to create a field Priority_word only if the condition is true . So if the priority.value is between 1 to 3 then new scripted field should say low else medium.
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.