Elasticsearch 00:00:01 Saved does not yet mean searchable A shop saves product seven, refreshes its search page immediately, and sees no result. Follow an Elasticsearch write from its primary shard to the separate event that makes it visible to search. The hash of id p7 modulo 3 is 1. Its primary is on node 2. The primary sends the same operation to the replica of shard 1 on node 3. With request-level translog durability and the illustrated in-sync copies, the client receives a successful write acknowledgement after the required durable operations. A subsequent refresh exposes a new searchable segment. Its timing depends on the index settings and workload. A refresh opens a searchable view of recent changes. It serves a different purpose from crash durability. Choose the appropriate refresh behavior when a publishing workflow needs immediate search visibility. 00:00:56 Three shards nominate two winners The shopper now asks for the two best matching products. The coordinating node selects an eligible copy of each relevant shard, and the work can proceed in parallel. All three shards run the query on their own index at the same time. Each shard sends its top two candidates with their identifiers and sort information. In the example six local candidates compete for two global slots. The coordinator retains products A and C. Only now the two documents are read, from their shards. Fetching full documents only after the global winners are known keeps the first phase light. A slow shard can still dominate the time until the buyer sees the result. 00:01:37 What is a running shoe? The catalog contains the text Running Shoes. Before tuning relevance, ask what actually entered the inverted index. Different field mappings can index the same input very differently. The field holds Running Shoes. A keyword field can retain the entire phrase as one exact value, useful for grouping or sorting. In the standard-analyzer example the phrase becomes the lowercase tokens running and shoes. The illustrated English analyzer also stems those words to run and shoe. Use an analyzed text field for words and a suitable keyword field for exact categories or aggregations. Run the analyzer on both your example and the customer's question before guessing why a result is missing. 00:02:22 Count brands while the buyer filters A laptop search returns a hundred candidates. The storefront sidebar needs brand counts alongside its product hits. Decide what population those counts should describe before choosing where to apply the brand filter. 100 laptops are found. The terms aggregation counts the brands. Choosing Dell as an ordinary filter also filters the counts. The other brands vanish. In the revised query the aggregation observes the broader set. The post-filter then narrows the displayed hits. A post-filter can narrow hits after the broader aggregation is computed. Use that separation when the buyer should still see alternative brand counts while browsing one brand. 00:03:03 Page five hundred and one The buyer scrolls deep into a catalog containing five shards. Offset-based pagination makes earlier candidates compete again even though the caller only wants the next twenty. For a first page of twenty results, five shards return up to one hundred candidates in this example. An offset of ten thousand with a page of twenty would require up to fifty thousand one hundred candidates here. The standard result-window limit typically rejects that request unless settings change. Search-after uses the last hit's sort values to continue. Each shard can return the next page's candidates without rebuilding every earlier hit. A stable sort with a tie-breaker and, when consistent traversal matters, a point-in-time view, gives the next request a reliable place to continue. Pagination is part of the search algorithm's workload.