# Can you get different results from replica and primary if queried at the same time?

**URL:** <https://discuss.elastic.co/t/can-you-get-different-results-from-replica-and-primary-if-queried-at-the-same-time/324732>\
**Category:** Elasticsearch\
**Created:** [February 5, 2023, 12:13pm UTC](https://discuss.elastic.co/t/can-you-get-different-results-from-replica-and-primary-if-queried-at-the-same-time/324732 "2023-02-05T12:13:36Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![BenB196](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benb196/32/83401_2.png) [@BenB196](https://discuss.elastic.co/u/BenB196)\
**Post date:** [February 5, 2023, 3:04pm UTC](https://discuss.elastic.co/t/can-you-get-different-results-from-replica-and-primary-if-queried-at-the-same-time/324732/5 "2023-02-05T15:04:41Z")

</div>

Based on what I can [find](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html#delete-distributed), delete operations should follow the same model as [writing documents](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-replication.html#basic-write-model). Therefore, you shouldn't get a successful response when deleting until all in-sync replicas have acknowledged the delete. Elasticsearch [should only search](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-replication.html#_failures) in-sync shards.

Something you might be running into is shard refresh delays, where one shard might've refreshed and removed the document from search, while the other shard might not have refreshed yet, and still have the document available for search. This [thread](https://discuss.elastic.co/t/how-refresh-works-between-primary-and-replica-shards/219181/2) goes into the topic a bit more.  
You might want to try passing the `refresh=true` [query parameter](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html#docs-delete-api-query-params) on the delete request to see if that helps resolve what you're seeing.

---

_[View the full topic](https://discuss.elastic.co/t/can-you-get-different-results-from-replica-and-primary-if-queried-at-the-same-time/324732)._
