semanticRatio parameter: pure keyword search, pure semantic search, and hybrid search. Each mode has strengths and weaknesses depending on your data and how your users search.
This page helps you understand the tradeoffs and pick the right approach for your use case.
The three search modes
ThesemanticRatio parameter controls how Meilisearch blends keyword and semantic results:
When to use each mode
Pure keyword search (semanticRatio = 0)
Best when:- Users search for exact product names, SKUs, or identifiers
- Your dataset contains structured data with specific terminology (legal documents, medical records)
- You need deterministic, explainable results
- You want to avoid the latency cost of generating query embeddings
"iPhone 15 Pro Max 256GB""error code 0x80070005""Moby Dick Herman Melville"
Pure semantic search (semanticRatio = 1)
Best when:- Users describe what they need in natural language rather than using specific terms
- Your content is homogeneous (all product descriptions, all articles, all Q&A pairs)
- Vocabulary mismatch is common (users say “laptop” but documents say “notebook computer”)
- You are building conversational search or Q&A features
"something to keep my coffee warm at my desk""how do I fix a leaky kitchen faucet""comfortable shoes for standing all day"
Hybrid search (0 < semanticRatio < 1)
Best when:- Your users mix specific terms with natural language descriptions
- Your dataset contains diverse content types
- You want to catch both exact matches and conceptually relevant results
- You are building ecommerce search, documentation search, or knowledge bases
"wireless ergonomic keyboard"(keyword “wireless” + semantic “ergonomic”)"python async database connection"(technical terms + conceptual meaning)"red summer dress under $50"(product attributes + style description)
Tradeoffs
Relevancy
Hybrid search typically delivers the best overall relevancy for general-purpose applications. Pure keyword search excels for exact-match queries but misses conceptually similar results. Pure semantic search handles vocabulary mismatch well but may miss results that contain the exact query terms.Latency
The latency difference depends on your embedder. Cloud-based embedders (OpenAI, Cohere) add network overhead for query embedding generation. Local embedders (HuggingFace) avoid network calls but use server CPU.
Vocabulary mismatch handling
This is where semantic search provides the most value. Consider a kitchenware dataset:
Hybrid search balances these scenarios. It returns the exact “KitchenAid KFE5T” match from keyword search while also surfacing conceptually relevant “pancake flipper” results from semantic search.
Decision guide
Use the following table to choose your startingsemanticRatio:
These are starting points. Test with real queries from your users and adjust based on the results you observe.
When NOT to use hybrid search
Hybrid search is not always the best choice. Consider pure semantic search (semanticRatio: 1.0) instead when:
- Image-only search: if your data is purely visual (image catalogs with no text metadata), keyword search has nothing to match against. Use pure semantic search with multimodal embeddings.
- Similarity-based use cases: if you are building a recommendation system using the
/similarendpoint, you are already using pure vector similarity. Hybrid search does not apply. - Pre-computed embeddings without text: if you provide your own embeddings for non-textual content (audio, sensor data), there are no keywords to match.
Next steps
Custom hybrid ranking
Fine-tune semanticRatio and test different configurations
Full-text search
Learn more about Meilisearch’s keyword search capabilities
Hybrid search overview
Overview of hybrid and semantic search in Meilisearch