I got another index where I had Elastic do the mapping and for some reason it does work there by using 'myfield.keyword'. Adding .keyword to the field for the other two indices does not work.
In the two indices that don't return any results, myfield is mapped as keyword only.
if (doc['stringnumber']) {
return Double.parseDouble(doc['stringnumber'].value)
}
Note that you can troubleshoot scripted fields nicely by using constants instead of document fields until you've got the syntax correct, then drop in your fields. To do this, you would simply build a scripted field with this code:
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.