I converted a string into int using scripted fields. Now I am trying to subtract this field with another field inside the the index pattern. My document looks something like this:
So I am creating a scripted field like that doc['test2_int_to_subtract'].value - doc['example.value_to_subtract'].value,
however I have shard failure in discover.
org.elasticsearch.search.lookup.LeafDocLookup.get(LeafDocLookup.java:94)
org.elasticsearch.search.lookup.LeafDocLookup.get(LeafDocLookup.java:41)
doc['test2_int_to_subtract'].value - doc['example.value_to_subtract'].value
^---- HERE
What am I doing wrong?
Thank you very much in advance!
I tried that but still have the same error with this caused reason:
No field found for [fields.test2_int_to_subtract] in mapping with types []
Is it because the fields are not under the _source? Another thing that I am seeing is that under _source the fields are inside {} but under fields the scripted field is inside [].
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.