elasticsearch search group by having condition code example Example: Elasticsearch for group by like in sql select *, count(*) from schools group by schools