Is there a way In Elasticsearch 5.3 to loop through query results using painless script to compute difference between the hits returned by query.
I was trying to loop through the results in a for loop in script and could not what entity to loop on, i was hopping that scripts have something like the update api has ctx.payload.hits.hits that can be used in for loop.
"script": {
"lang": "painless",
"inline": "int total = 0; for (int i = 0; i < ??? ; i++) { total += ???[i]._source['age'].value; } return total;"
}
How will that turn out if the field is a Timestamp field. During the combine phase of Scripted metric aggregation. if the data is randomly stored across the shards then there is a possibility of overlapping ranges.
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.