Home Ask Login Register

Developers Planet

Your answer is one click away!

Jonas Stensved February 2016

How can I sort by _geo_distance in NEST for Elasticsearch?

Is it possible to sort by _geo_distance with the NEST library for Elastic Search? I can't find any support for it.

The raw json for doing what I want is:

"sort": [
         "_geo_distance": {
            "position": {
               "lat": 59.3389428,
               "lon": 18.0761637
            "order": "asc",
            "unit": "m",
            "distance_type": "plane"


bittusarkar February 2016

var results = client.Search<object>(sd => sd
    .SortGeoDistance(d => d
        .PinTo(Lat: 59.3389428, Lon: 18.0761637)

Post Status

Asked in February 2016
Viewed 2,608 times
Voted 10
Answered 1 times


Leave an answer

Quote of the day: live life