Need which exact value matched in an array

Hi all,
I have many documents in my index.
Each document is having a field "location" which is an array of geo_points.

I query ES by the geo_distance query with a lat,lon as input & say 50m radius.
When i get result i am unable to guess which of the points in the array are in the 50m radius that i have specified (unless i go and check manually).

This case is quite similar to matching a text in a field which is an array. I am unable to tell which value has matched.

Possible solution that needs inputs:
I can match the input field by iterating the array of field. But that only work if the input value is exactly same as that in array. In case if the input value is an analyzed token its not possible to match the input value with that in array.

Please help, its a very critical problem we are facing throughout our application.


I wonder if you can use a script field [1] and use painless to filter out the points that don't match with painless? The painless reference [2] for org.elasticsearch.index.fielddata.ScriptDocValues.GeoPoints offers sufficient methods.


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.