Hi,
I started playing around today with Elasticsearch. I indexed a couple of
documents that look like this :
{
"location": {
"name": "Montreal",
"location": {"lat": 45.50884, "lon": -73.58781}
}
}
and then I know that I can do something like this to get the locations that
are nearest first
{
"query" : {
"match_all" : {}
},
"sort" : [{
"_geo_distance": {
"location": {
"lat": 45.5247,
"lon": -73.5894
},
"order": "asc",
"unit": "km"
}
}]
}'
but how can I also specify that I also only want the locations that are
within a given distance/radius?
Hi,
I'm not an expert - far from this. But I found this on the docs. Maybe
it's what you want, isn't it?
Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.
Regards,
Em quarta-feira, 11 de julho de 2012 23h09min33s UTC-3, Patrick Paul-Hus
escreveu:
Hi,
I started playing around today with Elasticsearch. I indexed a couple of
documents that look like this :
{
"location": {
"name": "Montreal",
"location": {"lat": 45.50884, "lon": -73.58781}
}
}
and then I know that I can do something like this to get the locations
that are nearest first
{
"query" : {
"match_all" : {}
},
"sort" : [{
"_geo_distance": {
"location": {
"lat": 45.5247,
"lon": -73.5894
},
"order": "asc",
"unit": "km"
}
}]
}'
but how can I also specify that I also only want the locations that are
within a given distance/radius?