我正在为正在从事的项目使用 Elasticsearch ,我想知道是否有办法缩小从索引统计信息搜索中得到的结果。
https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html
我目前使用docs
来缩小我获得的有关索引的数据的范围,但是现在我只想获取文档计数大于0的数据。有人知道这是否可行或如何实现?
谢谢!
Elasticsearch 1.5.2
最佳答案
如果您担心响应的大小(即,如果您有许多索引且包含许多分片),则最好的方法是使用response filtering(仅从ES 1.7开始可用),并且仅检索可进一步过滤的docs
字段在客户端:
curl 'localhost:9200/_stats/docs?pretty&filter_path=**.docs.count'
关于elasticsearch - 我可以缩小Elastic Search _stats获得的结果吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32080587/