Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SortGeoDistance() does not support sort mode #770

Closed
mkeperling opened this issue Jul 9, 2014 · 2 comments
Closed

SortGeoDistance() does not support sort mode #770

mkeperling opened this issue Jul 9, 2014 · 2 comments
Milestone

Comments

@mkeperling
Copy link

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!

@Mpdreamz Mpdreamz added this to the NEST 1.0 milestone Jul 16, 2014
@Mpdreamz
Copy link
Member

Hi @mkeperling I see you already started work on this mind sending a PR for your work:

https://github.com/mkeperling/elasticsearch-net/commit/03fa9bfb3171366cdaa83e826600355d15153da3

And sign our CLA when you do: http://www.elasticsearch.org/contributor-agreement/

Thanks!

@gmarz gmarz mentioned this issue Jul 18, 2014
@gmarz
Copy link
Contributor

gmarz commented Jul 18, 2014

@mkeperling we were hoping to receive a PR from you, but we wanted to get this in for the GA release and couldn't wait any longer. I've gone ahead and added sort_mode in the above PR #807. Thanks for bringing this to our attention!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants