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