Search count deprecated, how to get all buckets?

I have an aggregation that sums a field and buckets the field by another field.

I understand from Elastic 2.3 release changes that the search_type=count is deprecated. I am running Elastic 2.2 and when I remove the search_type=count and add a ""size":0" clause to the body, I get my aggregation counts as before.

However, with the size 0 clause I only see the first 10 buckets. How to do I get all the buckets of the aggregation and the counts?

Thanks, beckerdo

I think I found the answer. If I put ""size": 0" in the aggregation term, then I get all the buckets. Putting ""size": 0" in the request body outer scope returns counts rather than full document.

So, in summary, you need two of these size clauses.

What is the maximum number of buckets that can be returned when process an aggregation query that has the "size" set to 0?