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?

3

0

Your Answer

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.