# Index document count is 0 after reindexing

**URL:** <https://discuss.elastic.co/t/index-document-count-is-0-after-reindexing/227199>\
**Category:** Elasticsearch\
**Created:** [April 8, 2020, 7:39pm UTC](https://discuss.elastic.co/t/index-document-count-is-0-after-reindexing/227199 "2020-04-08T19:39:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![achang77](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@achang77](https://discuss.elastic.co/u/achang77)\
**Post date:** [April 8, 2020, 7:39pm UTC](https://discuss.elastic.co/t/index-document-count-is-0-after-reindexing/227199/1 "2020-04-08T19:39:16Z")

</div>

I am attempting to validate some reindex from remote operations  
I am reindexing from a "source" cluster to a "destination" cluster  
for an index "IndexName" I run the following  
` r = esDest.reindex(body=query, wait_for_completion=True)`  
then I compare  
`es.cat.count(index = [indexName], h=['count'])`  
between the source cluster and destination cluster  
The value of the source cluster will be `1234`, while the value from the destination will be `0`.  
However if I call `time.sleep(123456)` for some period of time depending on the size of the index, before I do the comparison, the value from the destination will be `1234`, which passes the test as I have defined it.  
Why is this happening and how can I intelligently decide how long to wait?

---

<div class="post-metadata">

**Author:** ![oneoneonepig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oneoneonepig/32/66018_2.png) [@oneoneonepig](https://discuss.elastic.co/u/oneoneonepig)\
**Post date:** [April 10, 2020, 3:16am UTC](https://discuss.elastic.co/t/index-document-count-is-0-after-reindexing/227199/2 "2020-04-10T03:16:25Z")

</div>

@achang77 Try adding the refresh option when sending bulk requests.

You can find the option [HERE](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html#docs-bulk-api-query-params)  
And [THIS](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-refresh.html) explains what refresh is.

---

<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:** [May 8, 2020, 3:16am UTC](https://discuss.elastic.co/t/index-document-count-is-0-after-reindexing/227199/3 "2020-05-08T03:16:29Z")

</div>

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