Getting the distance back in geo_distance queries

Hi

I am trying out the geo search features of ES. So I ran the following
query.
curl -XGET 'http://localhost:9200/activities/69482975/_search?
pretty=true' -d '
{
"query" : {
"filtered" : {
"query" : {
"match_all" : {}
},
"filter" : {
"geo_distance" : {
"distance" : "200km",
"geo.coordinate" : "45.53226,-122.68145"
}
}
}
},
"size" : 5
}
}'

Is there any way, I could get the calculated distance from the point
(geo.coordinate) being searched on, in the search results and sort by
that calculated distance, much like the geodist function in Solr
spatial search.

Thanks
Diptamay

Yes, you can sort by geo distance: Elasticsearch Platform — Find real-time answers at scale | Elastic. You will also get the values back.

-shay.banon
On Wednesday, March 23, 2011 at 4:50 AM, diptamay wrote:

Hi

I am trying out the geo search features of ES. So I ran the following
query.
curl -XGET 'http://localhost:9200/activities/69482975/_search?
pretty=true' -d '
{
"query" : {
"filtered" : {
"query" : {
"match_all" : {}
},
"filter" : {
"geo_distance" : {
"distance" : "200km",
"geo.coordinate" : "45.53226,-122.68145"
}
}
}
},
"size" : 5
}
}'

Is there any way, I could get the calculated distance from the point
(geo.coordinate) being searched on, in the search results and sort by
that calculated distance, much like the geodist function in Solr
spatial search.

Thanks
Diptamay