June 2017
Beginner to intermediate
404 pages
8h 22m
English
When you have a large number of buckets, it is possible to filter the buckets that contain documents below a specified threshold value:
POST chapter8/_search { "size": 0, "aggs" :{ "category_products" : { "terms" : { "field" : "category", "min_doc_count": 5 } } } }
In the preceding query, all the buckets that don't contain a minimum of 5 documents will be excluded from the results.
Read now
Unlock full access