【发布时间】:2015-02-12 16:27:42
【问题描述】:
我正在创建一个报告来比较数据库中的实际计数与索引记录。
我有三个索引 index1、index2 和 index3
要获取单个索引的计数,我使用以下 URL
http://localhost:9200/index1/_count?q=_type:invoice
=> {"count":50,"_shards":{"total":5,"successful":5,"failed":0}}
对于多个索引:
http://localhost:9200/index1,index2/_count?q=_type:invoice
=> {"count":80,"_shards":{"total":5,"successful":5,"failed":0}}
现在计数已加起来,我希望它按索引分组,我如何按特定字段传递过滤器组 得到这样的输出:
{"index1_count":50,"index2_count":50,"approved":10,"rejected":40 ,"_shards":{"total":5,"successful":5,"failed":0}}
【问题讨论】:
标签: elasticsearch