Elasticsearch 中的 terms 聚合,如何得到所有 buckets 的数量?
資深大佬 : JJstyle 3
原问题: https://stackoverflow.com/questions/66043206/how-to-get-the-buckets-count-from-terms-aggregation-in-elasticsearch
比如:得到所有订单数量大于 10 的用户总数,类似于 SQL 语句:
select count(1) from ( select count(1) as cnt from orders group by userid having cnt >= 10 );
大佬有話說 (5)