Elasticsearch如何高效统计特定数据集的数量?
- 内容介绍
- 文章标签
- 相关推荐
本文共计174个文字,预计阅读时间需要1分钟。
Elasticsearch 统计查询结果数量,请求IP:端口/index/type/_search,查询条件:name包含aaaa
Elasticsearch根据条件统计结果数量
post ip:port/index/type/_search{ "from": 0, "size": 0, "query": { "bool": { "must": [{ "match_phrase": { "name": { "query": "aaaa", "slop": 0, "boost": 1 } } }, { "range": { "startTime": { "from": 1661616000391, "to": null, "include_lower": true, "include_upper": true, "boost": 1 } } } ] } }, "_source": { "includes": [ "COUNT" ], "excludes": [] }, "aggregations": { "COUNT(*)": { "value_count": { "field": "_index" } } }}java代码:
本文共计174个文字,预计阅读时间需要1分钟。
Elasticsearch 统计查询结果数量,请求IP:端口/index/type/_search,查询条件:name包含aaaa
Elasticsearch根据条件统计结果数量
post ip:port/index/type/_search{ "from": 0, "size": 0, "query": { "bool": { "must": [{ "match_phrase": { "name": { "query": "aaaa", "slop": 0, "boost": 1 } } }, { "range": { "startTime": { "from": 1661616000391, "to": null, "include_lower": true, "include_upper": true, "boost": 1 } } } ] } }, "_source": { "includes": [ "COUNT" ], "excludes": [] }, "aggregations": { "COUNT(*)": { "value_count": { "field": "_index" } } }}java代码:

