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.

Multiple values/sources for composite aggregations

See original GitHub issue

Currently the implementation for composite aggregations is limited to a single field due to a bug. The Composite class:

https://github.com/elastic/elasticsearch-dsl-py/blob/e9c548ce940a9782619258e4bb65a482d807ef16/elasticsearch_dsl/aggs.py#L215

The sources type has a value 'hash': True whereas in practice for multiple aggregated fields one actually need to pass a list of hashes.

This list of hashes seems (in my incredibly short experience of elasticsearch) like an uncommon pattern. I have a fix locally by introducing sources as a list - see (https://github.com/howespt/elasticsearch-dsl-py/commit/3d854a8533b547ca840f5fd30431ed1f90a84d70)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
honzakralcommented, Nov 19, 2018

Thank you for your patience, a fix has just been pushed, release coming soon.

0reactions
davkap92commented, Nov 12, 2018

I think I also do…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Composite aggregation | Elasticsearch Guide [8.5] | Elastic
This will create composite buckets from the values created by two value sources, a date_histogram and a terms . Each bucket is composed...
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 >
Elasticsearch Composite Aggregations - How to Use ... - Opster
Composite aggregations are multi-bucket aggregations that combine buckets from many sources to produce composite buckets.
Read more >
How to use multiple Composite Aggregations in ElasticSearch?
In the response, you can see the first aggregation ( total ) with 1000s of objects in the bucket but the second one...
Read more >
Elasticsearch 7 Composite Aggregation - Logi Analytics
properties ) can be used to specify the maximum number of buckets to return for each query within a composite aggregation. Valid values...
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