I'm new to embeddings and search
Read the semantic search overview, then try its small-corpus example to see queries and documents compared by similarity.
Start with: Semantic Search
RedLectern topic
Learned representations · vector search · keyword search · hybrid retrieval · reranking.
For: Builders · technical learners
After this page you can: Choose and test a retrieval method for a collection.
Page reviewed
Part of: Artificial Intelligence › Retrieval-augmented generation
Search methods represent and rank collection items in different ways. A learned embedding maps an item such as text or an image to a numerical vector. Vector search compares these representations; semantic search uses that comparison to find items related in meaning. Keyword search instead relies on textual terms, which can make it useful when a query contains an exact name, identifier, or phrase.
There is no method to choose by label alone. Build a small set of real queries and the items that should be retrieved, then compare the results. Check whether relevant items appear, where they rank, and whether latency and operating constraints fit your use. Hybrid retrieval combines result lists from methods such as dense vector and lexical search; a reranker can then reorder a shortlist. The sections below offer ways to try these choices and examine the results.
Read the semantic search overview, then try its small-corpus example to see queries and documents compared by similarity.
Start with: Semantic Search
See how text features and BM25 support lexical matching and ranking.
Start with: Feature extraction from text
Learn how dense and sparse search results can be fused, and when an exact term may matter.
Start with: Hybrid Search: Dense and Sparse
An embedding is a numerical representation, and vector search finds items by comparing their representations. A vector database can store vectors and support similarity search; a vector index organizes them to speed up candidate search. Approximate nearest neighbor (ANN) methods can trade some precision for faster or smaller searches, so compare their returned candidates against an exact baseline when that matters.
Semantic search uses represented meaning, while keyword search matches textual terms. BM25 is a lexical ranking method with term-frequency normalization and document-length normalization. Hybrid search combines results from different retrieval methods, for example dense vectors with sparse lexical vectors. Exact terms, such as a code or identifier, can be important to test alongside paraphrased queries.
Documents BM25 and its term-frequency and document-length normalization settings.
Introduces vector indexes and similarity search, including a precision and speed trade-off.
Embedding
A learned numerical representation of text, images, or other items.
Vector database
A datastore that stores vector representations and supports similarity search.
Vector index
A data structure that organizes vectors to speed up searches among them.
Semantic search
Retrieval that uses represented meaning rather than matching only textual terms.
Keyword search
Retrieval based on matching textual terms.
Hybrid search
Retrieval that combines methods such as keyword and vector search.
BM25
A keyword-ranking method that uses term-frequency and document-length normalization.
Approximate nearest neighbor
A method for efficiently finding vectors likely to be close without checking every candidate.
For a help collection, compare these queries: “reset a forgotten password” and “ERR-1042.” Which retrieval method or methods would you test first for each, and what would you inspect in the results?
Test semantic search for the paraphrased password query and keyword search for the exact error code. Also test hybrid search on both. Inspect whether the intended help item appears and where it ranks.
Choose by the failures you observe in your own queries. Semantic search can retrieve relevant passages expressed with different words; lexical search can match terms that must be exact. Hybrid search runs more than one method and fuses their result lists, so it is a candidate to test when the query set contains both paraphrases and exact terms. Fusion methods differ: reciprocal rank fusion uses result positions, while score-based combinations depend on scores that may be on different scales.
Make a small labeled set of queries paired with relevant items before changing settings. Compare each method on the same queries, and keep a held-out portion for checking whether a tuning choice generalizes. Decide what counts as improvement for your use: relevant results in the shortlist, better top ranks, or a latency target.
Describes combining dense and sparse query results and choosing among fusion approaches.
Presents a benchmark spanning varied text retrieval tasks and retrieval system types.
Create four test queries for a collection: one paraphrase, one exact identifier, one query containing both, and one query that should return no result. For each, name a method to compare and what a useful result would contain.
Compare semantic search on the paraphrase, keyword search on the identifier, and both methods plus hybrid search on the mixed query. For the no-result query, inspect whether each method returns irrelevant candidates. Record the relevant items and their ranks.
Retrieval first produces candidates; a reranker can score that shortlist again against the query and change its order. This adds a ranking stage, so compare it with the original results on the same labeled queries. Keep candidate retrieval and reranking distinct in your evaluation: if a relevant item never enters the candidate set, a later reorder cannot surface it.
Before tuning, decide what better retrieval means for the workload and choose a metric and labeled query set that can reveal that change. Check both ranking quality and practical costs such as latency. When you tune fusion weights on labeled queries, use separate tuning and evaluation queries; measuring on the tuning queries alone can inflate the apparent result.
A RAG answer can still be wrong. Inspect five parts separately: retrieval quality, answer faithfulness, factual correctness, citation support, and permissions.
Explains reranking text inputs for semantic relevance to a query and its use after an existing search.
Explains vector similarity search and that some index methods trade precision for speed or memory.
A relevant item appears at rank 18 in your retrieved candidates. You rerank only the first 10. What should you check before concluding that the reranker failed?
Check whether the item entered the top 10 candidate set. If it did not, the reranker could not reorder it. Measure candidate recall separately from the reranked ordering.
No recent updates are available.
Christopher D. Manning, Prabhakar Raghavan, and Hinrich Schütze · 2008
Build a foundation in indexing, Boolean retrieval, vector-space scoring, and evaluation. Stanford provides the chapters free from the book website.
W. Bruce Croft, Donald Metzler, and Trevor Strohman · 2010
Relate retrieval models to search-engine design and components. The authors’ site offers a free download.
Stefan Büttcher, Charles L. A. Clarke, and Gordon V. Cormack · 2016
Study search-engine implementation and experiments, including indexing, retrieval, ranking, and evaluation.
Trey Grainger, Doug Turnbull, and Max Irwin · 2025
Explore embedding-based semantic search alongside sparse lexical retrieval, hybrid search, and learned ranking.
Omar Alonso and Ricardo Baeza-Yates (eds.) · 2024
Use it as an advanced IR reference alongside a course covering document representation, neural ranking, and retrieval evaluation.