> For the complete documentation index, see [llms.txt](https://xiaoxiami.gitbook.io/elasticsearch/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xiaoxiami.gitbook.io/elasticsearch/ji-chu/36aggregationsju-he-fen-679029/366jin-fan-hui-xu-yao-ju-he-de-jie-679c28-returning-only-aggregation-results.md).

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

有许多场合需要聚合，但搜索匹配不需要。对于这些情况，可以通过设置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避免执行搜索的提取阶段，从而使请求更有效率。
