Keyword search finds matching words. Semantic search finds matching meanings.
Clear example
Stored document:
Employees may work remotely during severe weather.
User search:
Can I work from home during heavy rain?
Keyword search may struggle because the exact words are different.
Semantic search uses embeddings and can understand that:
- work from home is related to remote work
- heavy rain is related to severe weather
Comparison
| Keyword search | Semantic search |
| Matches words and phrases | Matches meaning |
| Good for exact IDs and names | Good for natural-language questions |
| Fast and easy to explain | Understands synonyms and related concepts |
| May miss different wording | May retrieve conceptually related but incorrect results |
When keyword search is better
Use keyword search for:
- order ID:
ORD-1042 - exact error code:
ECONNREFUSED - email address
- product name
- quoted phrase
- filters such as status or date
Embeddings may treat similar IDs as related even though only one exact ID is correct.
When semantic search is better
Use semantic search for:
- questions written in natural language
- support articles
- policies and documentation
- synonyms
- recommendations
- similar tickets or documents
Hybrid search
Production systems often combine both:
Final results =
keyword matches + semantic matches + metadata filters
Example query:
Find documents related to "payment failed"
AND product = "mobile app"
AND version = "4.2"
- Semantic search understands "payment failed."
- Keyword or metadata filters precisely match product and version.
Reranking
A search system may retrieve several possible results and then use another scoring step to reorder them.
Retrieve candidates โ rerank by relevance โ send best chunks to LLM
You only need reranking when basic retrieval quality is not good enough.
Common mistakes
- using embeddings for exact identifiers
- using only keywords for natural questions
- returning too many loosely related chunks
- ignoring metadata and permissions
- assuming a high similarity score guarantees correctness
Use keyword search for exactness, semantic search for meaning, and hybrid search when you need both.