# Does sum\_other\_doc\_count include docs without that field?

**URL:** <https://discuss.elastic.co/t/does-sum-other-doc-count-include-docs-without-that-field/286028>\
**Category:** Elasticsearch\
**Created:** [October 6, 2021, 12:55pm UTC](https://discuss.elastic.co/t/does-sum-other-doc-count-include-docs-without-that-field/286028 "2021-10-06T12:55:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)\
**Post date:** [October 6, 2021, 12:55pm UTC](https://discuss.elastic.co/t/does-sum-other-doc-count-include-docs-without-that-field/286028/1 "2021-10-06T12:55:16Z")

</div>

I'm performing a terms agg that gives me 5 top buckets and a `sum_other_doc_count` against a specific field.  
Not every document in my index has that field.

Does `sum_other_doc_count` include a count of documents without the field I'm agg-ing on?

Thanks!

---

<div class="post-metadata">

**Author:** ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)\
**Post date:** [October 19, 2021, 2:46pm UTC](https://discuss.elastic.co/t/does-sum-other-doc-count-include-docs-without-that-field/286028/2 "2021-10-19T14:46:21Z")

</div>

I believe the answer to this is that documents without the field entirely are not counted at all, so will not appear in the `sum_other_doc_count`.

---

<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:** [November 16, 2021, 2:46pm UTC](https://discuss.elastic.co/t/does-sum-other-doc-count-include-docs-without-that-field/286028/3 "2021-11-16T14:46:56Z")

</div>

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