An interactive explainer

A search never reads your documents. It reads one row of an index.

A scan opens every document on every query. Elasticsearch opens them once, while they are written, and builds an index: one row per word, holding the list of documents that word appears in. After that a search reads a row, not the corpus. Watch the index grow document by document, break it by changing the analyzer, lose a document to the one-second refresh, and survive a node dying.

Elasticsearch · Inverted index · Full-text search

Databases & Search · Intermediate · 12 min · How Elasticsearch finds your needle in a billion documents — an interactive explainer on ViLearn, with a simulation and a knowledge check. All explainers.

Related: How a database finds one row in a million · The list that only says no · Why two correct transfers can lose money