What Is Semantic Search? β Definition and How It Works
Learn what semantic search is, how vector retrieval differs from keyword matching, why hybrid search wins in practice, and how results are re-ranked.
Semantic search matches a query to documents by meaning rather than by shared words, so a question phrased in the user's vocabulary can retrieve a document written in someone else's.
1. What Is Semantic Search?
Semantic search retrieves by conceptual similarity, using embeddings rather than term overlap.
- Key idea: compare what the text means, not which strings it contains.
- Mechanism: query and documents become vectors; ranking is by distance in that space.
- Goal: find the right document when the user's words and the author's words differ.
Example of the Difference
Query: "my payment did not go through"
Keyword search β documents literally containing "payment", "go", "through"
Semantic search β "Failed transactions", "Declined cards", "Billing errors"
Neither retrieved title shares a distinctive term with the query.
2. How It Works
- Documents are split into passages and embedded once, at index time.
- The query is embedded at search time with the same model.
- The store returns the nearest passages by cosine similarity.
- A re-ranking step reorders the shortlist using a more expensive, more accurate model.
- The top passages are returned, or passed to a language model to compose an answer.
Step four is the cheapest large quality win in most systems: retrieve broadly with vectors, then re-rank a few dozen candidates precisely.
3. Semantic Compared With Keyword Search
| Aspect | Keyword (lexical) | Semantic (vector) |
|---|---|---|
| Matches | Exact terms, stems, and synonyms you configure | Meaning, including paraphrase |
| Rare identifiers | Excellent β a part number matches exactly | Weak β unusual strings are poorly represented |
| Negation | Literal, so "not supported" differs from "supported" | Weak β the two land close together |
| New vocabulary | Works immediately | Requires the term to have been in training data |
| Tuning | Analysers, synonyms, field weights | Model choice, chunking, re-ranking |
The two fail in opposite directions, which is why production search combines them.
4. Why Hybrid Search Wins
Hybrid search runs both retrievers and fuses the results, typically by combining ranks rather than raw scores, since the two score scales are not comparable.
The practical benefit shows up on queries that mix natural language with an exact token β a symptom described in prose alongside an error code, or a question about a specific SKU. Vectors handle the prose; the lexical index anchors the identifier.
5. What Makes It Fail
- Bad chunking. A passage split away from its heading loses the context that made it findable.
- Boilerplate in the index. Navigation and footers embed as content and dilute the space.
- Mismatched models. Query and documents must be embedded by the same model.
- Negation and quantities. "Under 50 ms" and "over 50 ms" are close in vector space; filters or lexical constraints must carry that weight.
- Stale index. Meaning matching does not help if the document has not been re-indexed since it changed.
6. Real-World Examples
- Help centres where users describe symptoms and articles are written in product vocabulary.
- Job and candidate matching, where "built data pipelines" should surface a CV that says "ETL engineering".
- Legal and policy review, where a concept appears under many phrasings across long documents.
- Retrieval for LLM answers, where semantic search chooses which passages enter the context window.
- Product discovery, where a shopper describes a use case rather than a category name.
7. Common Misconceptions
- "It replaces keyword search." It fixes vocabulary mismatch and introduces the opposite weakness. Exact identifiers still need a lexical index.
- "Better results mean a better model." Chunking, boilerplate removal, and re-ranking usually move quality more than swapping the embedding model.
- "Scores can be thresholded universally." A cutoff tuned on one corpus and model rarely transfers to another.
- "Recency is handled automatically." Nothing about vector search prefers newer documents; freshness is a metadata filter you have to apply.
8. Summary
Semantic search ranks by meaning using embeddings, solving the vocabulary-mismatch problem that limits keyword search. Its blind spots β exact identifiers, negation, precise numbers β are exactly where lexical search is strongest.
The reliable architecture is hybrid retrieval followed by re-ranking, built on clean text and sensible passage boundaries. The retriever is usually easier to improve than the model consuming its output.