alpha, so you can tune relevance per query.
As with all queries, load the index first (or open a session).
The alpha parameter
alpha lives on QueryOptions.
alpha | Behavior |
|---|---|
1.0 | Pure semantic (embeddings only) |
0.0 | Pure keyword (BM25 only) |
| between | Blends the two; default is semantic-heavy at 0.8 |
Example
alpha applies inside a session:
Choosing alpha
- Lower
alpha(toward keyword) when queries contain exact identifiers, SKUs, names, or jargon. - Higher
alpha(toward semantic) when queries are natural-language paraphrases. - Tune per index and per intent (returns, billing, onboarding, and so on).
Related
- Metadata filtering - constrain results by document metadata.
- Custom embeddings - bring your own vectors.
- QueryOptions - all query parameters.
- SDK reference - the full JavaScript SDK overview.