Overview
Full-text search allows you to:- Search across multiple text fields
- Rank results by relevance score
- Handle Unicode text correctly
- Filter common words automatically
- Scale to large document collections
Text search requires a text index to be created first. Regular indexes don’t support full-text search.
Creating a text index
Single field index
Create a text index on one field.Multi-field index
Search across multiple fields simultaneously.Searching
Basic search
Search for documents and get results sorted by relevance.Understanding relevance scores
Scores represent how well a document matches the query:- Higher scores = more relevant
- Scores are based on TF-IDF algorithm
- Documents are automatically sorted by score (highest first)
How it works
Tokenization
Text is broken into tokens (words) using Unicode-aware word boundaries.- Case-insensitive (converted to lowercase)
- Unicode word boundaries
- Filters single-character tokens
- Preserves contractions (“let’s”, “don’t”)
TF-IDF scoring
Relevance is calculated using Term Frequency-Inverse Document Frequency:Advanced usage
Multi-word queries
Search for multiple terms - documents matching more terms score higher.Search and filter
Combine full-text search with regular queries.Currently, you cannot combine search with query filters in a single operation. Fetch results and filter in your application.
Paginating search results
Real-world examples
Blog search
Product search
Documentation search
Support ticket search
Performance optimization
Index creation
Search performance
Memory usage
Limitations
Best practices
Tokenization details
What gets indexed
Edge cases
Comparison with regular indexes
Next steps
Indexes
Create regular indexes for exact matches
Querying
Filter search results with queries
Performance
Optimize search performance
CRUD operations
Insert searchable documents