Hybrid Search in Azure AI Search
Hybrid search combines the strengths of vector search and keyword search in a single query request, providing better results than either method alone.What is Hybrid Search?
Hybrid search executes both full-text and vector queries simultaneously, then merges results using Reciprocal Rank Fusion (RRF).Vector Search
Finds semantically similar content regardless of exact keywords
Keyword Search
Finds exact matches with precision on names, codes, dates
Why Use Hybrid Search?
Complementary Strengths
- Vector search: High recall, semantic understanding
- Keyword search: High precision, exact matches
- Combined: Best of both worlds
Benchmark Results
Hybrid search with semantic ranker offers significant improvements in search relevance over either method alone.How Hybrid Search Works
Query Execution
- Parallel execution: Full-text and vector queries run simultaneously
- Independent ranking: Each query uses its own ranking algorithm
- Result fusion: RRF merges and reranks all results
- Single response: Unified result set returned to client
Hybrid Query Structure
search: Full-text query stringvectorQueries: One or more vector queriesfilter: Apply to both queriestop: Final result count after fusion
Reciprocal Rank Fusion (RRF)
RRF combines multiple result sets by:d= documentk= constant (typically 60)rank_i(d)= rank of document in result set i
Example Fusion
Text results:- Doc A (score: 10.5)
- Doc B (score: 8.2)
- Doc C (score: 6.1)
- Doc C (score: 0.89)
- Doc A (score: 0.85)
- Doc D (score: 0.82)
- Doc A: 1/61 + 1/61 = 0.0328
- Doc C: 1/63 + 1/61 = 0.0323
- Doc B: 1/62 + 0 = 0.0161
- Doc D: 0 + 1/63 = 0.0159
With Semantic Ranking
Add semantic ranking for even better results:- Execute full-text and vector queries
- Apply filters
- Merge with RRF
- Semantic reranking on top 50 results
- Return top results
Filtering in Hybrid Search
Filters apply to both query types:Filter Modes
preFilter: Apply before vector search (faster, fewer candidates)postFilter: Apply after vector search (more candidates, slower)
Multiple Vector Queries
Search multiple vector fields:Use Cases
Product Search
Product Search
- Keywords: Exact product codes, SKUs
- Vectors: Product descriptions, features
- Result: Find by code OR similar products
Document Search
Document Search
- Keywords: Author names, dates, document IDs
- Vectors: Content similarity
- Result: Precise metadata + semantic content
Knowledge Base
Knowledge Base
- Keywords: Technical terms, acronyms
- Vectors: Conceptual similarity
- Result: Exact terminology + related concepts
Best Practices
Set k=50
For semantic ranker, use k=50 to provide sufficient input
Use Filters
Pre-filter to reduce search scope and improve performance
Test Weights
Experiment with vector weights to optimize for your data
Monitor Performance
Track query latency and result quality metrics
Next Steps
Vector Search
Learn about vector search concepts
Full-Text Search
Master keyword query syntax
Semantic Ranking
Add ML-based reranking