# \_cat/indices docs.count does not match indice \_count - why?

**URL:** <https://discuss.elastic.co/t/-cat-indices-docs-count-does-not-match-indice--count-why/49966>\
**Category:** Elasticsearch\
**Created:** [May 13, 2016, 6:48am UTC](https://discuss.elastic.co/t/-cat-indices-docs-count-does-not-match-indice--count-why/49966 "2016-05-13T06:48:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vandamo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vandamo/32/8203_2.png) [@vandamo](https://discuss.elastic.co/u/vandamo)\
**Post date:** [May 13, 2016, 6:48am UTC](https://discuss.elastic.co/t/-cat-indices-docs-count-does-not-match-indice--count-why/49966/1 "2016-05-13T06:48:41Z")

</div>

Hi,  
I'm currently migrating our indices from Elasticsearch 1.x to ElasticSearch 2.3.1.  
I had to do it due to many of our even fields containing dots, so being exposed to the related breaking change, so scripted the migration to perform a search and replace on any of those dots in the json field names.

As I was validating the advancement of the migration, I typically used \_GET _cat/indices/myindices\*?v_ to get a quick view of the indices being migrated.

Due to the docs.count being different between the indices on 1.x and 2.x, I started to dig deeper. The more puzzling aspect being that the docs.count on the 2.x was higher than on the 1.x (and only input to Elasticsearch 2.x was my migration script).

Checking the docs count through GET myindices-2016.04.05/\_count on 2.x didn't return the same information than through the \_cat/indices interface, but did match the expected count.  
On 1.x, both interfaces return the same value.

**Would someone have an idea how this came to be?**

###Elasticsearch 1.x:

####GET \_cat/indices/myindice-2016.04.05?v

```
health status index pri rep docs.count docs.deleted store.size pri.store.size 
green open audit-2016.04.05 5 0 3129036 0 62.7gb 62.7gb 

```

####GET myindice-2016.04.05/\_count

```
{
  "count": 3129036,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  }
}

```

* * *

###Elasticsearch 2.x:

####GET \_cat/indices/myindice-2016.04.05?v

```
health status index pri rep docs.count docs.deleted store.size pri.store.size 
green open myindice-2016.04.05 1 0 3409028 0 24.5gb 24.5gb 

```

####GET myindice-2016.04.05/\_count

```
{
  "count": 3129036,
  "_shards": {
    "total": 1,
    "successful": 1,
    "failed": 0
  }
}

```

* * *

###Elasticsearch 2.x exact version:

```
"version": {
  "number": "2.3.1",
  "build_hash": "bd980929010aef404e7cb0843e61d0665269fc39",
  "build_timestamp": "2016-04-04T12:25:05Z",
  "build_snapshot": false,
  "lucene_version": "5.5.0"
}

```

Please note that the differences in size is normal, as I'm performing some cleanup of the events while migrating them. The difference as to the number of shards per index is also intended, as the number of index we'd like to keep open requires us to reduce the number of shards per index or increase the size of our cluster, the latter not being an option at the moment.

---

<div class="post-metadata">

**Author:** ![vandamo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vandamo/32/8203_2.png) [@vandamo](https://discuss.elastic.co/u/vandamo)\
**Post date:** [June 1, 2016, 7:33am UTC](https://discuss.elastic.co/t/-cat-indices-docs-count-does-not-match-indice--count-why/49966/2 "2016-06-01T07:33:27Z")

</div>

After some additional research, wondering if the "issue" is not related to information available on the following page:  
[Indices Stats [Elasticsearch 1.3]](https://www.elastic.co/guide/en/elasticsearch/reference/1.3/indices-stats.html)  
That states:

> docs

> The number of docs / deleted docs (docs not yet merged out). Note, affected by refreshing the index. Also, docs.count here include the count of nested documents. So if you have a single document with 2 associated nested documents, the index’s docs.count will show 3.

This information has for some reason disappeared from the latest version of the documentation.

---

<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 5, 2017, 10:47pm UTC](https://discuss.elastic.co/t/-cat-indices-docs-count-does-not-match-indice--count-why/49966/3 "2017-07-05T22:47:23Z")

</div>


