Best practice for aggs query

In aggs query, if I want to have:
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
or very small.
Is a good practice to run before, the aggs query, another query to have the number of hits and the set this value in the "size" aggs query field? Or there is a better strategy?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.