Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Search by vector

Query a Telys collection with a precomputed query vector using search(), and read back ids, scores, optional metadata, and an explain trace.

search is the raw-vector query path: pass a query vector of exactly dim values and Telys returns the nearest records. Use it when you already have query embeddings, or on a vectors-only collection. To query with a string, see Search by text.

Signature

Collection.search(
    vector,
    top_k=10,
    where=None,
    explain=False,
    target_recall=None,
    with_metadata=False,
) -> dict
Parameter
Type
Default
Meaning

vector

1-D float32 (length dim)

—

The query vector. Its length must equal the collection's dim.

top_k

int

10

Maximum number of results to return.

where

Eq | dict | None

None

Restrict to a partition/filter column (see Filter results).

explain

bool

False

Add an "explain" trace describing how the query ran.

target_recall

float | None

None

Per-query recall/latency hint for the planner (e.g. 0.95).

with_metadata

bool

False

Add a "metadata" list aligned with the returned ids.

The result is always {"ids": [...], "scores": [...]}, plus "explain" when explain=True and "metadata" when with_metadata=True. ids are ordered best-match first; scores[i] matches ids[i].

Basic query

Return metadata and an explain trace

Filter and tune per query

Use where to constrain to a partition or filter column, and target_recall to nudge the recall/latency tradeoff:

Expected result

ids and scores are parallel lists ordered best-match first. with_metadata=True adds a metadata list in the same order, so result["ids"][0] and result["metadata"][0] describe the same record:

Next steps

Last updated

Was this helpful?