question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for Composite Aggregation

See original GitHub issue

Current elasticsearch-py release does not have support to Elasticsearch composite aggregation API.

Since I am using it, I handled the composite aggregation pagination manually, by multiple searches with the proper after element set in each request body. I propose two ways to integrate the composite aggregation in the client:

  1. an helper method elasticsearch.helpers.composite_agg(), similar to elasticsearch.helpers.scan(), that provides a simple abstraction on top of the composite aggregation API, i.e. a simple iterator that yields all hits as returned by underlining composite aggregation requests.
  2. by adding the parameter after in search(**kwargs), that similarly to the parameter scroll allows the user to specify the after element in the next request and continue the paging.

What do you think? If they are sound, I can start preparing my PR.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:8
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
fxdgearcommented, Mar 7, 2019

Feel free to open a PR 😃

I’ll gladly review it. Sorry for the delay in response ☹️

0reactions
Troffificommented, Aug 19, 2021

Hi. This will be really useful! Can you share with us the progress on this feature request?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Composite aggregation | Elasticsearch Guide [8.5] | Elastic
This aggregation provides a way to stream all buckets of a specific aggregation, similar to what scroll does for documents.
Read more >
Composite aggregation doesn't support min_doc_count option
The aggregation works fine on it's own. Only when I put it in a composite-aggregation it fails. ... I hope this is just...
Read more >
Elasticsearch Composite Aggregations - How to Use ... - Opster
The composite aggregation allows you to paginate every bucket from a multi-level aggregation effectively, unlike other multi-bucket aggregations. In a manner ...
Read more >
Composite Aggregation
A multi-bucket aggregation that creates composite buckets from different sources. Unlike the other multi-bucket aggregation the composite aggregation can be ...
Read more >
Does Composite aggregation support minimum doc count filter?
min_doc_count is not supported by the composite aggregation and according to this issue it doesn't seem like it will ever be the case....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found