Geo_distance sort shapes

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

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

Thank you @spinscale this is a great help.

I'm going to stick to Mongo to do this for now.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.