Elasticsearch shards, replicas and refresh 00:00:01 The merchant can read a missing search result A merchant saves a product, receives an acknowledgment and immediately searches for it by name. The result is empty. Yet looking up the newly assigned product identifier can succeed. Where did those two reads diverge? In this search engine, a real-time identifier lookup can see a recent accepted change before it becomes visible through the ordinary searcher. Its implementation need not read the same segment view. The write was durable, but the new item isn't visible in searches because the searcher hasn't been refreshed yet. For this example the seller has two ways to read the listing: fetch its known identifier or search for its words. A successful response from the first path is entirely compatible with a temporary miss on the second. 00:00:46 Publish searchable segments The primary coordinates a write with the required in-sync copies under the configured acknowledgment policy. That policy governs write success; it does not promise that all searchers already expose the document. A refresh on a shard opens a new searchable view of recent changes. Copies may refresh separately, so do not infer that one refresh made every copy in the entire cluster simultaneously current. Refresh makes recent index segments searchable. It is a different milestone from fsync, transaction-log durability, or a durable flush; searchable segments are not simply data kept only in memory. Durable replication, publishing a searchable view, and writing a longer-lived index checkpoint are distinct operations. Name which acknowledgment or visibility guarantee the application actually promised before diagnosing apparent data loss. 00:01:40 A query visits shard copies The document identifier can determine which logical shard owns this product at indexing time. An ordinary text query without a narrowing routing key may need to ask every relevant logical shard. The coordinator asks one suitable copy of each relevant shard for candidates, then merges those candidates. Asking both the primary and its replica as if they held different documents would double-count one logical shard. Additional replica copies can distribute concurrent search work when they have independent capacity, but every update and stored index must also be maintained on those copies. Two machines containing copies of the same logical shard do not contribute two different ranges of documents. Query one eligible copy for that shard, and combine results from the different logical shards that the search covers. 00:02:28 One shard response is missing First lose just a replica while its primary is healthy and eligible. The logical shard still has a searchable copy, so losing that replica need not make the query partial. Now lose every eligible copy of one relevant logical shard before the search deadline. A configured search might return explicitly partial results or fail the request. A healthy coordinator can merge only the shard responses it received. It cannot guarantee that the unavailable shard had no better candidate. Record whether all relevant shards answered. A search returning zero results after omitting the one shard that owned the matching item is an incomplete observation, not evidence the item is absent from the catalogue. 00:03:12 Promise the right visibility For immediate search visibility after write, wait for refresh only when the user needs to see the item right away. To confirm the product was saved, use a direct ID lookup instead of relying on search results. Monitor indexing lag and search latency to catch replica issues early and ensure consistent availability. Verify the entire seller journey: save, direct lookup and broad text search. Monitoring all three reveals whether a customer saw a failed write, a delayed refresh or an incomplete search response.