The vector database explained how Elasticsearch stores and navigates vectors. This essay is about everything around that: where embeddings come from, the two very different shapes they take, what to do when documents are too long to embed whole, and the heavier models that polish the final ranking. Map a field as semantic_text and Elasticsearch runs all of it for you; this essay is what "all of it" means.
Elastic's own ELSER model produces sparse vectors: instead of coordinates in an abstract space, it expands text into weighted terms, including terms that never appear in the text, the ideas it implies. The expansion is interpretable, you can read it, and it is served by the ordinary inverted index. Pick an input, and see how it finds a document it shares no words with:
Embedding models read a bounded window of text; a hundred-page manual doesn't fit, and even when text fits, one vector for a whole document blurs all its topics together. So semantic_text automatically chunks long fields: each chunk embedded separately, each searchable on its own. By default it groups whole sentences into chunks of up to 250 words, overlapping by one sentence. Chunk size is a real trade, and you can feel it:
A single vector per chunk is still a summary, and summaries blur. A higher-precision technique keeps one vector per token and compares query and document token-by-token: each query token finds its best match in the document, and the score is the sum of those best matches, maxSim. Elasticsearch stores such vectors in the rank_vectors field. Compare two documents against the same query:
Everything so far runs at retrieval scale, over millions of documents. The last refinement runs on the podium only: a reranker, a cross-encoder that reads query and candidate together, token interactions and all, and re-orders the top handful with far more care than any first pass could afford. Since acquiring Jina AI, Elastic serves Jina's multilingual rerankers and embedding models through its inference service, alongside ELSER. Cheap judges nominate; an expensive judge decides; the same economics as everything else in this machine.
How the lexical and semantic candidate lists get merged before the reranker sees them, reciprocal rank fusion, lives in The vector database.
Assembled, a semantic pipeline is a funnel of three stages, each smarter and more expensive per document than the last, so each sees fewer documents: retrieve broadly, fuse the lists, rerank the survivors. Each stage has a k, and the three k's are the entire economics of the system. Tune them: