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

Feature: Terms Aggregation with From Parameter #7956

Closed
kelaban opened this issue Oct 2, 2014 · 1 comment
Closed

Feature: Terms Aggregation with From Parameter #7956

kelaban opened this issue Oct 2, 2014 · 1 comment

Comments

@kelaban
Copy link

kelaban commented Oct 2, 2014

Forgive me if there is a better way to do this.

In the #6299, from was added to top_hits aggregations. If terms aggregations also had a from field, it would allow to to do distinct type of queries.

Consider the following documents in an index:

[
  { "revision": "a1", "id": 1, "updatedAt": 0 },
  { "revision": "b1", "id": 1, "updatedAt": 1 },
  { "revision": "a2", "id": 2, "updatedAt": 2 }
]

We can use a terms aggregation on id + top_hits aggregation sorted by updatedAt to get the latest revision for each id. However to get the second page of this request would be non-trivial as it would require getting both the first and second page of the top level terms aggregation combined in one response.

@kelaban kelaban changed the title Terms Aggregation From Offset Terms Aggregation with From Parameter Oct 2, 2014
@kelaban kelaban changed the title Terms Aggregation with From Parameter Feature: Terms Aggregation with From Parameter Oct 3, 2014
@clintongormley
Copy link

Hi @kelaban

Unfortunately, there is no better way to support from in aggregations than retrieving all the buckets you need. See #4915 for more discussion.

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