Elasticsearch 学习之子聚集过滤
Posted sunfie
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Elasticsearch 学习之子聚集过滤相关的知识,希望对你有一定的参考价值。
1. 获取子聚合结果总数 { "size": 0, "aggs": { "msisdnAgg": { "terms": { "field": "msisdn" }, "aggs": { "tagAggs": { "terms": { "field": "tags" } }, "sum_of_rul": { "sum_bucket": { "buckets_path": "tagAggs>_count" } } } } } } 2. 获取子聚合结果总数大于指定数 { "size": 0, "aggs": { "msisdnAgg": { "terms": { "field": "msisdn" }, "aggs": { "tagAggs": { "terms": { "field": "tags" } }, "sum_of_rul": { "sum_bucket": { "buckets_path": "tagAggs>_count" } }, "orderNumber_count_filter": { "bucket_selector": { "buckets_path": { "orderNumberCount": "sum_of_rul" }, "script": "orderNumberCount > 2 " } } } } } }
以上是关于Elasticsearch 学习之子聚集过滤的主要内容,如果未能解决你的问题,请参考以下文章