I am storing Book Titles in elasticsearch and they all belong to many shops. Like this:
{ \"books\": [ { \"id\": 1, \"tit
On the similar lines with SQL'S GROUP BY Elasticsearch provides aggregation
With aggregation queries, Elasticsearch responsds with Buckets.
One bucket corresponds to one category (group).