# Does min\_doc\_count impact the documents returned?

**URL:** <https://discuss.elastic.co/t/does-min-doc-count-impact-the-documents-returned/310787>\
**Category:** Elasticsearch\
**Created:** [July 27, 2022, 6:32pm UTC](https://discuss.elastic.co/t/does-min-doc-count-impact-the-documents-returned/310787 "2022-07-27T18:32:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattkallo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkallo/32/109746_2.png) [@mattkallo](https://discuss.elastic.co/u/mattkallo)\
**Post date:** [July 27, 2022, 6:32pm UTC](https://discuss.elastic.co/t/does-min-doc-count-impact-the-documents-returned/310787/1 "2022-07-27T18:32:59Z")

</div>

Hi - I have 2 questions regarding term aggregations min\_doc\_count setting.

1. Will min\_doc\_count limit the documents returned or just the bucket/term in aggregation? Say I have 200 documents and 120 of them have the term "elasticsearch" and 80 with term "kibana" and if I set the min\_doc\_count to 100 on the field that contains these terms, would a search query (that matches all 200) return all 200 documents or only the ones that has "elasticsearch". My query by itself matches both "elasticsearch" and "kibana".

2. Is setting min\_doc\_count to a high number expected to improve search (aggregation) speed? I tried this in my sample setup, but got a mixed result - could be because of other issues.

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 24, 2022, 6:33pm UTC](https://discuss.elastic.co/t/does-min-doc-count-impact-the-documents-returned/310787/2 "2022-08-24T18:33:10Z")

</div>

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