Vector Search vs Keyword Search
What you'll learn: How vector search differs from traditional keyword search in finding relevant information.
The Core Difference
Keyword search (also called lexical search) works like Ctrl+F — it looks for exact word matches. If you search for "car," it finds documents containing "car" but might miss "automobile" or "vehicle."
Vector search uses semantic similarity. It converts both your query and documents into embeddings (numerical vectors), then finds documents whose meaning is closest to your query — even if they use completely different words.
Concrete Examples
Keyword Search:
- Query:
"best Italian restaurants" - Matches: Documents with those exact words
- Misses: "Top-rated pasta places," "Great trattorias nearby"
Vector Search:
- Query:
"best Italian restaurants"(converted to embedding) - Matches: Documents about Italian dining, even using words like "authentic pizzerias," "recommended eateries serving pasta," or "where to eat in Little Italy"
When Each Shines
Keyword search excels when:
- You need exact matches (product SKUs, error codes)
- Documents contain precise technical terms
- Speed matters more than understanding context
Vector search excels when:
- Users phrase questions naturally ("Why is my code slow?" vs "performance optimization")
- Synonyms and paraphrases matter
- You want conceptually similar results, not just matching words
Think of keyword search as a librarian who only knows the card catalog by exact title. Vector search is like a librarian who understands what you're actually looking for and can recommend related books even if you described them vaguely.
Key Takeaway: Keyword search matches words; vector search matches meaning. Vector search captures semantic similarity that keyword search misses, making it ideal for natural language queries and conceptual searches.