Return distance in elasticsearch results?
Yes you can, by using a script field. For instance, assuming your doc have a geo-point field called location, you could use the following: (note the \u0027 is just an escaped single quote, so \u0027location\u0027 is really ‘location’) curl -XGET ‘http://127.0.0.1:9200/geonames/_search?pretty=1’ -d ‘ { “script_fields” : { “distance” : { “params” : { “lat” : … Read more