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?