# Doc count match

**URL:** <https://discuss.elastic.co/t/doc-count-match/186838>\
**Category:** Elasticsearch\
**Created:** [June 21, 2019, 8:50am UTC](https://discuss.elastic.co/t/doc-count-match/186838 "2019-06-21T08:50:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Animesh\_singh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/animesh_singh/32/46768_2.png) [@Animesh\_singh](https://discuss.elastic.co/u/Animesh_singh)\
**Post date:** [June 21, 2019, 8:50am UTC](https://discuss.elastic.co/t/doc-count-match/186838/1 "2019-06-21T08:50:09Z")

</div>

Hey ,  
Can anynone tell me why there is difference between result of doc count API for match all and document count displayed in cat/indices result for a particular index .  
Or these doc counts are totally different because in my case doc count has vary large difference .  
count API for match all gives -\> 6087276  
cat/indices for that index gives -\> 33720620

---

<div class="post-metadata">

**Author:** ![thekm1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thekm1/32/35926_2.png) [@thekm1](https://discuss.elastic.co/u/thekm1)\
**Post date:** [June 21, 2019, 9:11am UTC](https://discuss.elastic.co/t/doc-count-match/186838/2 "2019-06-21T09:11:21Z")

</div>

Hi @Animesh_singh  
I checked it on my indices, and i get the same results with count API(match all) and \_cat/indices.  
Maybe it is better to understand if we can see the query and response in here.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 21, 2019, 10:07am UTC](https://discuss.elastic.co/t/doc-count-match/186838/3 "2019-06-21T10:07:33Z")

</div>

If you are updating your documents you also need to consider the number of deleted documents reported by the `_cat/indices` API.

---

<div class="post-metadata">

**Author:** ![Animesh\_singh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/animesh_singh/32/46768_2.png) [@Animesh\_singh](https://discuss.elastic.co/u/Animesh_singh)\
**Post date:** [June 22, 2019, 1:15pm UTC](https://discuss.elastic.co/t/doc-count-match/186838/4 "2019-06-22T13:15:56Z")

</div>

ok , i got that , but one more thing if i reindex to different index and then check \_cat/aliases gives same total number of docs but deleted becomes zero . So can i say that record of total number of documents are transferred to new index but not the number of deleted ones .  
ex-\>  
index1- \_cat/alias =\> total docs -\>33720620 deleted docs -\> 21324423 , Match\_all - 60k someting  
reindexed all data of index1 to index 2 -  
index2- \_cat/alias =\> total docs -\>33720620 deleted docs -\> 5343, Math\_all - same as above  
CONTINIOUS UPDATE HAPPENS ON BOTH INDEXES

---

<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:** [July 20, 2019, 1:15pm UTC](https://discuss.elastic.co/t/doc-count-match/186838/5 "2019-07-20T13:15:58Z")

</div>

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