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.
-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.
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.