1. Returning only aggregation results(仅返回需要聚合的结果)

原文链接 : https://www.elastic.co/guide/en/elasticsearch/reference/5.4/returning-only-agg-results.html

译文链接 : Returning only aggregation results(仅返回需要聚合的结果)

贡献者 : 程威ApacheCNApache中文网

有许多场合需要聚合,但搜索匹配不需要。对于这些情况,可以通过设置size = 0来忽略掉。例如:

curl -XGET 'localhost:9200/twitter/tweet/_search?pretty' -H 'Content-Type: application/json' -d'
{
  "size": 0,
  "aggregations": {
    "my_agg": {
      "terms": {
        "field": "text"
      }
    }
  }
}
'
将大小设置为0避免执行搜索的提取阶段,从而使请求更有效率。
Copyright © Kilvn 2021. all right reserved,powered by Gitbook最后更新时间: 2021-06-08 20:22:42

results matching ""

    No results matching ""