# Data Consistency Challenges in Elasticsearch Cluster 

**URL:** <https://discuss.elastic.co/t/data-consistency-challenges-in-elasticsearch-cluster/361293>\
**Category:** Elastic Search\
**Created:** [June 12, 2024, 4:43am UTC](https://discuss.elastic.co/t/data-consistency-challenges-in-elasticsearch-cluster/361293 "2024-06-12T04:43:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![saleem\_ullah](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saleem_ullah/32/126297_2.png) [@saleem\_ullah](https://discuss.elastic.co/u/saleem_ullah)\
**Post date:** [June 12, 2024, 4:43am UTC](https://discuss.elastic.co/t/data-consistency-challenges-in-elasticsearch-cluster/361293/1 "2024-06-12T04:43:06Z")

</div>

I'm having trouble with my data consistency. I set up a cluster with three servers. Inside it, there's an index with two replica sets and two primary shards. I'm using Monstache to keep my data in sync with MongoDB. The issue is that every time I search using es\_obj, the results come back in a different order. To fix this, I added a preference key with a random string acting as a session ID. This helps maintain consistency for my searches during my session. However, if my teammate runs the same code on another server with the same session ID, they get different results. Even when I restart my service, the results change. How can I make sure the order of results remains consistent across sessions until my data changes?

---

<div class="post-metadata">

**Author:** ![ashishtiwari1993](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashishtiwari1993/32/135241_2.png) [@ashishtiwari1993](https://discuss.elastic.co/u/ashishtiwari1993)\
**Post date:** [June 12, 2024, 11:12am UTC](https://discuss.elastic.co/t/data-consistency-challenges-in-elasticsearch-cluster/361293/2 "2024-06-12T11:12:38Z")

</div>

Hi @saleem_ullah, Welcome the Elastic community. Are you facing this while searching data into Elasticsearch or mongodb ?

---

<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 10, 2024, 11:12am UTC](https://discuss.elastic.co/t/data-consistency-challenges-in-elasticsearch-cluster/361293/3 "2024-07-10T11:12:57Z")

</div>

Closed on July 10, 2024, 11:12am UTC

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