Maximum number of documents considered for aggregation

I know that the number of results is limited by the "size" parameter, but is there a maximum number of documents that elasticsearch "looks through" when performing an aggregation query? I want to make sure that the totals reported in my aggregations are going to be accurate as the sizes of my indexes increase.

They'll be accurate. You can use terminate_after to make them not accurate if you want.

The size and offset parameters control the number of documents returned in the fetch phase. The terminate_after parameter controls the number of documents collected by the query phase. Aggregations are a part of the query phase.

Great! Thank you.