Semantic Search
Search that compares not letters, but meaning. Queries and documents are turned into embeddings, and the closest vectors are found.
What Sets It Apart from Keyword Search
| Keyword | Semantic | |
|---|---|---|
| Principle | Exact word match | Vector proximity |
| "cats" finds "cat" | No | Yes |
| Exact articles | Yes | May miss |
How It Works
- Documents go through vectorization.
- The query is also turned into a vector.
- Vector DB finds the nearest by cosine similarity.
Strengths and Weaknesses
- Strength — understands synonyms and rephrasing;
- Weakness — misses exact numbers, articles, rare terms.
Therefore, in production, a hybrid search is often used: semantics + keywords.