Skip to main content
Finds the nearest neighbors of one or more query vectors. With query_contents, the service embeds the text first (the index needs an embedding_model). With text, the query becomes hybrid: BM25 full-text ranking is fused with the vector ranking.

Parameters

Returns

  • Single query vector: List[Dict], one dict per neighbor.
  • Batch of two or more vectors: List[List[Dict]], one inner list per query vector.
A query with exactly one vector always returns single results, even when it’s sent as a batch or through the binary path.

Result fields

query() never returns vector or contents, even when they’re listed in include. To read them, pass the result IDs to get().

Exceptions

Neither query_vectors nor query_contents is passed. Raised before any request is sent.
  • A NumPy query_vectors array is not 1-D or 2-D. Raised before any request is sent.
  • The service rejects the query (HTTP 400/422): wrong vector dimension, text on an index without full-text fields, or an out-of-range alpha, rrf_k, or window_mult. Other numeric parameters aren’t range-checked.
The index_key or api_key is invalid (HTTP 401).
The service returns 5xx or can’t be reached.
See Errors for the full hierarchy.

Example Usage

Single vector

Batch of vectors

Text, embedded by the service

Hybrid (BM25 + vector)

The index needs at least one full-text field, set with text_fields or {"full_text": True} in create_index().

Filters and search options