在SQL中,要对分组后的数据进行条件筛选,可以使用HAVING()
函数实现,比如以下的SQL语句:
SELECT COUNT(*) FROM
(
SELECT
senderResellerId,
SUM(requestAmountValue) AS t_amount
FROM
transactions
GROUP BY
senderResellerId
HAVING
t_amount > 10000 ) AS dum;
现在要在Elasticsearch(ES)中实现类似的查询,Elasticsearch(ES)的DSL查询语句应该如何实现呢?