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

aggregation Order supports multi field like Sort method #486

Closed
azihsoyn opened this issue Mar 21, 2017 · 3 comments
Closed

aggregation Order supports multi field like Sort method #486

azihsoyn opened this issue Mar 21, 2017 · 3 comments

Comments

@azihsoyn
Copy link
Contributor

Which version of Elastic are you using?

[ ] elastic.v2 (for Elasticsearch 1.x)
[ ] elastic.v3 (for Elasticsearch 2.x)
[x] elastic.v5 (for Elasticsearch 5.x)

Please describe the expected behavior

order condition will append like Sort.
https://github.com/olivere/elastic/blob/release-branch.v5/search.go#L228

https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-aggregations-bucket-terms-aggregation.html

Multiple criteria can be used to order the buckets by providing an array of order criteria such as the following:

Please describe the actual behavior

called after Order overrides query
https://github.com/olivere/elastic/blob/release-branch.v5/search_aggs_bucket_terms.go#L125

Thanks.

@olivere
Copy link
Owner

olivere commented Mar 21, 2017

Thanks for reporting and contributing to Elastic.

That makes perfectly sense. I just looked into the Java sources, and it's exactly like that. You can have 0 to many Order conditions.

I will have another look if this also applies to other aggregation types as well. So please give me a few days to check.

Thanks again.

@olivere
Copy link
Owner

olivere commented Mar 26, 2017

I renamed variables just a bit, but the PR just went in and is available in 5.0.31.

@azihsoyn
Copy link
Contributor Author

Thanks for merging!

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

2 participants