执行弹性搜索聚合,而不返回命中数组 [英] Perform Elasticsearch aggregation without returning hits array
本文介绍了执行弹性搜索聚合,而不返回命中数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用ES 1.4。当我执行聚合时,结果也返回命中数组。有没有办法只返回汇总?
Im using ES 1.4. When I perform an aggregation, the result returns the hits array as well. Is there a way to only return the aggregations?
推荐答案
这是可能的。您应该在Url中输入附加的参数(?search_type = count )。看看这里:
http: //www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations.html#_returning_only_aggregation_results
It is possible. You should type additional Parameter (?search_type=count) in your Url. Have a look here: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations.html#_returning_only_aggregation_results
这篇关于执行弹性搜索聚合,而不返回命中数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文