# How to get sum\_other\_doc\_count in aggregations?

**URL:** <https://discuss.elastic.co/t/how-to-get-sum-other-doc-count-in-aggregations/319200>\
**Category:** Logstash\
**Created:** [November 17, 2022, 1:52pm UTC](https://discuss.elastic.co/t/how-to-get-sum-other-doc-count-in-aggregations/319200 "2022-11-17T13:52:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Purushottam22](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/purushottam22/32/92715_2.png) [@Purushottam22](https://discuss.elastic.co/u/Purushottam22)\
**Post date:** [November 17, 2022, 1:52pm UTC](https://discuss.elastic.co/t/how-to-get-sum-other-doc-count-in-aggregations/319200/1 "2022-11-17T13:52:59Z")

</div>

I am running an aggregation to see what document types does my 'documents' index has (documentType is the field that has the type):

GET my\_documents/\_search  
{  
size: 0,  
"aggs": {  
"dataTypes": {  
"terms": {  
"field": "documentType"  
}  
}  
}  
}

I get results like:

"aggregations": {  
"dataTypes": {  
"doc\_count\_error\_upper\_bound": 0,  
"sum\_other\_doc\_count": 41,  
"buckets": [  
{  
"key": "pdf",  
"doc\_count": 63  
},  
{  
"key": "msw8",  
"doc\_count": 59  
},  
{  
"key": "pdf\_archive",  
"doc\_count": 11  
},  
{  
"key": "msw12",  
"doc\_count": 10  
},  
{  
"key": "mdoc55",  
"doc\_count": 9  
},  
{  
"key": "excel8book",  
"doc\_count": 7  
},  
{  
"key": "crtext",  
"doc\_count": 6  
},  
{  
"key": "maker55",  
"doc\_count": 5  
},  
{  
"key": "excel12book",  
"doc\_count": 4  
},  
{  
"key": "excel12bbook",  
"doc\_count": 2  
}  
]  
}  
}

I want to get sum\_other\_doc\_count value. Can anyone please help how can I do this

---

<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:** [December 15, 2022, 1:53pm UTC](https://discuss.elastic.co/t/how-to-get-sum-other-doc-count-in-aggregations/319200/2 "2022-12-15T13:53:54Z")

</div>

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