juanpujol
(Juan Pujol)
February 6, 2017, 7:17pm
1
What's the best way to sort by distance documents found by the geo_shape query?
Example, I'm running this query and I'll like to sort the documents found by the distance to the nearest point of a shape.
GET /gsp/_search
{
"query": {
"geo_shape": {
"geometry": {
"shape": {
"type": "circle",
"radius": "100km",
"coordinates": [-73.995175, 40.724822]
}
}
}
}
}
Thank you
spinscale
(Alexander Reelsen)
February 7, 2017, 8:29am
2
Hey,
sorting on shapes is currently not possible, see here
If you have shapes where can define a central point, you could use geo points, but that of course is just an approximation that is wildly wrong.
--Alex
juanpujol
(Juan Pujol)
February 7, 2017, 3:45pm
3
Thank you @spinscale this is a great help.
I'm going to stick to Mongo to do this for now.
system
(system)
Closed
March 7, 2017, 3:45pm
4
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.