Skip to content

SortGeoDistance() does not support sort mode #770

@mkeperling

Description

@mkeperling

According to the ES docs here:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#_geo_distance_sorting

Geo distance sorting should support sort_mode options min, max and avg. I have a scenario where my documents contain a field which is a collection of geo_points, and I need to sort by either min or max distance from origin under various conditions.

I'm using

query.SortGeoDistance(s => s
    .OnField(f => f.GeoLocations)
    .PinTo(-84.0, 39.0)
    .Unit(GeoUnit.Miles)
    .Ascending());

but so far have not found a way to apply the Min or Max modes to the geo sort. Locally I've modified the SortGeoDistanceDescriptor class to add mode support which is working fine, but I wanted to check to see if I was missing something that's already there.

Is there already a way to apply sort mode to SortGeoDistance?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions