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

Search Sort: _geo_distance sorting #306

Closed
kimchy opened this issue Aug 8, 2010 · 4 comments
Closed

Search Sort: _geo_distance sorting #306

kimchy opened this issue Aug 8, 2010 · 4 comments

Comments

@kimchy
Copy link
Member

kimchy commented Aug 8, 2010

Allow to sort by _geo_distance. Here is an example:

{
    "sort" : [
        {
            "_geo_distance" : {
                "pin.location" : [-40, 70],
                "order" : "asc",
                "unit" : "km"
            }
        }
    ],
    "query" : {
        "term" : { "user" : "kimchy" }
    }
}
@kimchy
Copy link
Member Author

kimchy commented Aug 8, 2010

implemented.

@otisg
Copy link

otisg commented Aug 9, 2010

What is the role of "unit" here? That is, the distance sort should always return hits in the same order regardless of unit of length, shouldn't it? Thanks.

@kimchy
Copy link
Member Author

kimchy commented Aug 9, 2010

Yes, it will. This ties into the ability to get the sort value(s) for each hit, and allows you to get it either in km or miles.

dadoonet pushed a commit to dadoonet/elasticsearch that referenced this issue Sep 4, 2015
ClaudioMFreitas pushed a commit to ClaudioMFreitas/elasticsearch-1 that referenced this issue Nov 12, 2019
Revert "fix version and add missing whitespace"
williamrandolph pushed a commit to williamrandolph/elasticsearch that referenced this issue Jun 4, 2020
@commitRahul
Copy link

to use sorting, Will I have to always use pin.location only as centre location ?

mindw pushed a commit to mindw/elasticsearch that referenced this issue Sep 5, 2022
…tag (pull request elastic#306)

improve power_stack script robustness

* improve robustness of script which was throwing KeyError for ASG that did not have StackName tag defined


Approved-by: fabien
costin pushed a commit that referenced this issue Dec 6, 2022
End-to-end support for grouping count aggregator function, e.g. _from
test | stats count(count) by data_.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants