Hi I am trying to query on elastic search by following the sql query and I want to implement same logic using Java API.
SELECT pid FROM test GROUP BY pid HAVING COUNT(id) > 1;
As i am new to ES i don't understand aggregations that well. please suggest how to implement the above using Java API.