I am trying to write a script to calculate the euclidean distance for some points stored as an array. Each array consists of 128 Double values.
The field is currently indexed and stored as such:
"my_array": [0.176, 0.165, 0.987, 0.67, ...]
When I use Painless to read and loop the array using
doc['my_array'].values; it returns the array sorted for some reason. So instead of the above I get the array as:
[0.165, 0.176, 0.67, 0.987, ...]
What other options do I have to get the array in the same order?
I am using ES 5.2