最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Running OpenSearch term aggregations in parallel - Stack Overflow

programmeradmin3浏览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?

发布评论

评论列表(0)

  1. 暂无评论