Because es returns the bucket size =10 by default after bucket splitting. That is, if there are many buckets after bucket splitting, how to get the total number of buckets?
So now I need to specify the total number of barrels after dividing them? That is, how many barrels will be divided?
Colleagues say that you can find out how many buckets are not returned by the following in the returned result: "sum other doc count".
In fact, it's not true. It just means how many documents are not divided into buckets. Because the bucket data you need has been found.
It can't be divided into barrels.
At present, I can only adjust the size of the bucket. When I write the size to the maximum, I return all the buckets
Example
GET /collect_data_store_goods_fact*/_search { "query": { "match_all": {} }, "size": 0, "aggs": { "brand":{ "terms": { "field": "orgId", "size": 1000000 } } ,"stats_monthly_sales": { "stats_bucket": { "buckets_path": "brand>_count" } } } } //Result { "took" : 7, "timed_out" : false, "_shards" : { "total" : 10, "successful" : 10, "skipped" : 0, "failed" : 0 }, "hits" : { "total" : { "value" : 30, "relation" : "eq" }, "max_score" : null, "hits" : [ ] }, "aggregations" : { "brand" : { "doc_count_error_upper_bound" : 0, "sum_other_doc_count" : 0, "buckets" : [ { "key" : 13274, "doc_count" : 17 }, { "key" : 19, "doc_count" : 7 }, { "key" : 7381, "doc_count" : 1 }, { "key" : 13278, "doc_count" : 1 }, { "key" : 13295, "doc_count" : 1 }, { "key" : 13296, "doc_count" : 1 }, { "key" : 13297, "doc_count" : 1 }, { "key" : 13298, "doc_count" : 1 } ] }, "stats_monthly_sales" : { "count" : 8, "min" : 1.0, "max" : 17.0, "avg" : 3.75, "sum" : 30.0 } } }
Then use count to get the number of barrels There's no way