SQL - having equivalent query strategy

Hi, I have the following query to be converted to DSL and executed on ES. I could not find a suitable aggregation and filter over results of aggregation available out-of-the-box in ES. As an alternative, I am fetching the 'group by count' for each id from ES and filtering the result as a part of my application logic, which is not efficient. Can you suggest any more suitable solution?

select distinct id from index where colA = "something" group by id having count(*) > 10;

index mapping
id : (string)
colA: (string)

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.