There is a “table” in Elasticsearch that looks like:
Now I make a request:
{ "size": 0, "aggregations": { "sport": { "terms": { "field": "prices.pharmacy.name" } } } } and get the answer:
{ "took": 2, "timed_out": false, "_shards": { "total": 30, "successful": 30, "failed": 0 }, "hits": { "total": 1999, "max_score": 0, "hits": [] }, "aggregations": { "sport": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "docmorris", "doc_count": 1000 }, { "key": "apotheke.com", "doc_count": 999 }, { "key": "shop", "doc_count": 999 } ] } } } How to make the shop and online.com in one "line" was?
"aggregations": { "sport": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "docmorris", "doc_count": 1000 }, { "key": "shop-apotheke.com", "doc_count": 999 }, ] } 