Hybrid Search: Keyword + Vector
What You'll Learn
You'll learn how combining traditional keyword search with vector similarity search creates a more powerful retrieval system than either approach alone.
The Core Idea
Hybrid search merges two complementary search methods:
- Keyword search (BM25) - Finds documents containing specific terms, great for exact matches, names, and rare words
- Vector search - Finds semantically similar documents, great for concepts and paraphrases
Think of it like asking for restaurant recommendations: keyword search finds places with "vegan pizza" in the menu, while vector search finds Italian restaurants with plant-based options. Together, they catch more relevant results than either alone.
Why Combine Them?
Each approach has strengths the other lacks:
- Vector search understands "cheap flights" and "affordable airfare" are similar, but might miss exact product codes or specific names
- Keyword search finds "iPhone 15 Pro" precisely but misses "latest Apple flagship phone"
Hybrid search runs both queries and combines their results, typically by:
- Computing separate scores for each method
- Normalizing scores to the same scale
- Weighted combination (e.g., 70% vector + 30% keyword)
- Reciprocal rank fusion for result merging
When to Use Hybrid Search
Use hybrid search when:
- Users mix specific terms with conceptual queries
- Exact matches matter (product IDs, names) but semantics also help
- You want the safety net of both approaches
The metadata filtering you learned earlier (lesson 278) works with both search types, giving you three-way power: keywords + vectors + filters.
Key Takeaway: Hybrid search combines BM25 keyword matching with vector similarity to leverage both exact-term precision and semantic understanding, producing more robust retrieval than either method alone.