Reranking
Thereranking parameter enables enhanced search result reranking using advanced AI models. It’s disabled by default (false) and incurs additional costs when enabled.
- Standard Reranking (
reranking: false, default): Uses a simpler, faster model with no additional cost - Advanced Reranking (
reranking: true): Uses state-of-the-art models for highest quality results at $1 per 1K operations
Semantic Weight
ThesemanticWeight parameter controls the balance between semantic search and full-text search in the hybrid search process. It accepts values from 0 to 1, with a default of 0.75 (75% semantic, 25% full-text).
- Higher semantic weight (0.7-1.0): Better for conceptual searches, finding related content, and handling synonyms
- Lower semantic weight (0.0-0.4): Better for exact keyword matching, technical queries, and specific terms
Input Enrichment
TheinputEnrichment parameter controls whether queries are enhanced using AI before searching. It’s enabled by default (true) and significantly improves search quality at the cost of some additional latency.
- When you need the fastest possible response times
- When you want to preserve the exact user query for full-text search
- Handles typos and alternative phrasings
- Expands queries with related terms and context
- Improves understanding of user intent
- Adds semantic context to ambiguous queries
Filter
Thefilter parameter allows you to restrict search results based on content criteria. It accepts either a string expression (SQL-like syntax) or a structured filter object (TypeScript SDK only).
Example: Complete Configuration
Here’s an example showing all parameters configured together:- Searches for ML content with enhanced query processing
- Returns up to 15 results
- Filters for data science content at beginner to intermediate levels
- Uses premium reranking for best quality results
- Emphasizes semantic matching (80%) over keyword matching (20%)
- Enables input enrichment for better intent understanding