Lexical Search¶
Lexical Search is a keyword-based search (similar to the search popularized by traditional search engines like Google) that finds exact or close matches to specific search terms in your content.
Overview¶
Recommended Search Type
While Hybrid Search is recommended for most use cases, Lexical Search can be the better choice when exact keyword matching is critical (e.g., legal documents, code search) or when you need the most cost-effective solution.
Lexical search focuses on finding literal matches of search terms and their variants, making it particularly effective for specific use cases where precise matching is required.
Key Features¶
- Exact Matching: Finds precise keyword matches in content
- Pattern Matching: Supports wildcards and regular expressions
- Cost-Effective: Lower computational requirements than AI-based search
- Predictable Results: Consistent matching based on exact terms
Best Use Cases¶
Lexical search excels in scenarios where:
- Exact keyword matching is critical (e.g., legal documents, code search)
- Search terms are highly specific (e.g., part numbers, error codes)
- Predictable, deterministic results are required
- Cost-effectiveness is the most important concern
Why Choose Lexical Search¶
Choose Lexical search when you need:
- Precise keyword matching
- Deterministic search results
- Search over structured data or specific terms
- The most cost-effective search solution
Search Type Selection
While we recommend starting with Hybrid Search, you can easily switch to Lexical search by changing the search_type
parameter in the Search Documents API.
Advanced Features
Our Lexical search includes modern search engine capabilities like typo tolerance, stemming, intelligent relevance scoring, etc. - making it more powerful than basic approaches like database full-text search.