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.
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
pydantic.ValidationError
pydantic.ValidationError
Neither
query_vectors nor query_contents is passed. Raised before any request is sent.cyborgdb.ValidationError
cyborgdb.ValidationError
- A NumPy
query_vectorsarray is not 1-D or 2-D. Raised before any request is sent. - The service rejects the query (HTTP
400/422): wrong vector dimension,texton an index without full-text fields, or an out-of-rangealpha,rrf_k, orwindow_mult. Other numeric parameters aren’t range-checked.
cyborgdb.AuthenticationError
cyborgdb.AuthenticationError
The
index_key or api_key is invalid (HTTP 401).cyborgdb.ServiceError / cyborgdb.TransportError
cyborgdb.ServiceError / cyborgdb.TransportError
The service returns
5xx or can’t be reached.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 withtext_fields or {"full_text": True} in create_index().