Skip to main content
Semantic (vector) search captures meaning; keyword (BM25) search captures exact terms. Hybrid search blends both with one parameter, alpha, set on QueryOptions. As with all queries, load the index first with load_index() (or open a session).

The alpha parameter

Example

alpha also applies inside a session query and composes with metadata filtering:

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).

Behavior notes

  • If you omit alpha, it defaults to 0.8.
  • alpha is ignored for multi-index search, which is embedding-only.

Metadata filtering

Constrain results by document metadata.

Custom embeddings

Bring your own vectors.