Elasticsearch计数

来源:互联网 发布:博尔量化源码 编辑:程序博客网 时间:2024/06/04 19:51

计数API允许我们执行一个匹配到的查询结果数量

import static org.elasticsearch.index.query.FilterBuilders.*;import static org.elasticsearch.index.query.QueryBuilders.*;CountResponse response = client.prepareCount("test")        .setQuery(termQuery("_type", "type1"))        .execute()        .actionGet();
1 0
原创粉丝点击