# Elasticsearch Primary/Replica DocFreq Not In Sync

**URL:** <https://discuss.elastic.co/t/elasticsearch-primary-replica-docfreq-not-in-sync/236599>\
**Category:** Elasticsearch\
**Created:** [June 11, 2020, 2:18am UTC](https://discuss.elastic.co/t/elasticsearch-primary-replica-docfreq-not-in-sync/236599 "2020-06-11T02:18:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hubert\_Pham](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hubert_pham/32/50565_2.png) [@Hubert\_Pham](https://discuss.elastic.co/u/Hubert_Pham)\
**Post date:** [June 11, 2020, 2:18am UTC](https://discuss.elastic.co/t/elasticsearch-primary-replica-docfreq-not-in-sync/236599/1 "2020-06-11T02:18:17Z")

</div>

Using an explain query, I'm seeing a drastic difference in the docFreqs between a query with preference for `_primary` vs one for `_replica`.

 ![Screen Shot 2020-06-10 at 12.02.26 PM](https://us1.discourse-cdn.com/elastic/original/3X/0/a/0ae3fc6657bf21d499782aa199cfab8647a9c72b.png)

The index is restored from a snapshot from a 5.4.3 cluster to a 6.8.6 cluster.

I've tried three approaches:

1. restoring the index with 0 replicas and then replicating
2. force merging & expunging deletes for the restored index and then re-replicating
3. reindexing from the restored index to a new index and then replicating

but nothing seems to sync the statistics between the primary and the replica.. This leads to shifting results depending on which type of shard the request lands on (primary vs replica).

Has anybody experienced this or know how to sync the statistics between the primary and replica?

---

<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 9, 2020, 2:18am UTC](https://discuss.elastic.co/t/elasticsearch-primary-replica-docfreq-not-in-sync/236599/2 "2020-07-09T02:18:24Z")

</div>

Closed on July 9, 2020, 2:18am UTC

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