0

We have a query calculating number of terms on multiple fields.


{
 "query": {
 "bool": {
 "filter": [
 {
 "term": {
 "your_filter_field": "your_filter_value"
 }
 }
 ]
 }
 },
 "aggs": {
 "aggregation_1": {
 "terms": {
 "field": "field_1"
 }
 },
 "aggregation_2": {
 "terms": {
 "field": "field_2"
 }
 },
 ...
 "aggregation_50": {
 "terms": {
 "field": "field_3"
 }
 }
 }
}

What we observe is that the aggregations are executed serially (OpenSearch 2.17). As a workaround we use multisearch sending each aggregation in its own query, which is faster, but it feels inefficient as we are executing the same filter multiple times. Is it possible to send multiple aggregations in one query while executing them in parallel?

asked Mar 14, 2025 at 12:31
3

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.