Find grand total of documents of the aggregation response

Hi All,

Is there any way I can find the grand total of aggregated response documents, tough it shows only 10 records ?

Are you talking about terms aggregations ?

Please note the inclusion of sum_other_doc_count in the response. If you sum this with the doc_count from all of the buckets, you will have the sum of the estimates of the counts of the docs.

Alternatively, you could just look at for the total matching documents.

Thank you for the response. You are right. but the sum_other_doc_count will show that is, how many documents are considered to do the aggregation. Is there any way I can find the grand total of bucket size, though I mentioned the size as 100. The result should have all the buckets size which was not showing as part of the result.

i.e., The grand total of buckets response size.

This solution will solve my problem. But I am using ES 2.2 version. is there any work around for this solution ?