Full-Text Search in Azure AI Search
Full-text search matches on plain text stored in an index using tokenization, lexical analysis, and BM25 relevance ranking.How Full-Text Search Works
Query Execution Stages
Query Architecture
Text Analysis
Analyzers
Transform text during indexing and querying: Standard Analyzer (default):- Lowercase all terms
- Remove punctuation
- Split on whitespace
- Remove stop words (“the”, “and”, “is”)
- 56 languages supported
- Language-specific stemming
- Stop word lists
- Define tokenization rules
- Configure character filters
- Specify token filters
Example Analysis
Input:"The Quick Brown Fox"
Standard Analyzer:
- Tokenize: [“The”, “Quick”, “Brown”, “Fox”]
- Lowercase: [“the”, “quick”, “brown”, “fox”]
- Remove stop words: [“quick”, “brown”, “fox”]
["quick", "brown", "fox"]
BM25 Ranking
Default relevance algorithm combining:Term Frequency (TF)
How often the term appears in the documentInverse Document Frequency (IDF)
How rare the term is across all documentsField Length Normalization
Shorter fields weighted higher Formula:- D = document
- Q = query
- qi = query term i
- f(qi,D) = term frequency
- |D| = document length
- avgdl = average document length
- k1, b = tuning parameters
Query Syntax
Simple Syntax
Default, user-friendly syntax: Boolean Operators:Full Lucene Syntax
Advanced features (requires"queryType": "full"):
Fielded Search:
Query Parameters
Search Fields
Limit search to specific fields:Search Mode
Control boolean logic:Query Type
Choose parser:Filters
Combine with filters for precise results:- Comparison:
eq,ne,gt,lt,ge,le - Logical:
and,or,not - Functions:
search.in(),geo.distance()
Faceted Navigation
Generate category counts:Relevance Tuning
Scoring Profiles
Boost specific fields or values:Freshness Boosting
Boost recent documents:Highlighting
Show matching snippets:Best Practices
Analyzer Selection
Analyzer Selection
- Use language analyzers for specific languages
- Custom analyzers for domain-specific terms
- Test with representative queries
Field Design
Field Design
- Mark fields searchable only when needed
- Use separate fields for exact vs analyzed matching
- Consider field length impact on scoring
Query Optimization
Query Optimization
- Use filters to reduce search scope
- Avoid wildcard prefixes (slow)
- Limit searchFields to relevant fields
Relevance Tuning
Relevance Tuning
- Start with default BM25
- Add scoring profiles incrementally
- A/B test changes with users
Common Patterns
Product Search
Document Search
Next Steps
Vector Search
Add semantic similarity search
Hybrid Search
Combine text and vector queries
Query Examples
More query patterns