【发布时间】:2016-01-28 13:53:55
【问题描述】:
我正在尝试获取包含 0 个文档的所有 Elasticsearch 索引的列表。
我的方法是查询_cat/indices
curl -GET 'http://localhost:9200/_cat/indices' -d '{
"query": { "match": { "docs.count": "0" } }
}'
但它似乎不起作用,因为我看到列出了超过 0 个文档的索引。
Cat indices 文档可以在这里找到:https://www.elastic.co/guide/en/elasticsearch/reference/1.6/cat-indices.html
有什么建议吗?
谢谢。
【问题讨论】:
-
你为什么不
grep来代替结果呢? -
事实上,我想做的是稍后从我的集群中删除这些索引(那些有 0 个文档的索引)。它们唯一的共同特征是它们匹配的文档数量。我可以在
docs.count上grep吗?
标签: curl elasticsearch indices documents