Query - v2 (Legacy)

Execute the v2 File Search endpoint against a collection. Returns retrieved chunks in search_results with content fields.

Path parameters

collection_namestringRequired

Request

This endpoint expects an object.
querystringRequired

Natural-language search query.

top_kinteger or nullOptionalDefaults to 10
Maximum number of search results to return.
metadata_filtermap from strings to any or nullOptional

Filter expression for indexed document metadata. Supports $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $and, and $or.

include_archivedbooleanOptionalDefaults to false

Include chunks archived by a sync archive deletion policy. Archived content is excluded from search by default; set true to surface it.

rerankboolean or object or nullOptionalDefaults to false

Rerank retrieved candidates before returning the top results (adds roughly 200 ms). Boolean form uses the defaults: voyage-rerank-2.5 over a pool of limit x 3 candidates. Object form tunes reranking — see RerankOptions. Multimodal collections default to reranking; an explicit false (or {"enabled": false}) opts out and returns a warning noting reduced cross-modal ranking quality. On v2, the deprecated inference=true path honours only the enabled/disabled state; the tuning fields apply to retrieval queries.

include_bboxboolean or nullOptionalDefaults to false
Legacy v2 layout option retained for clients that already depend on bounding boxes.
semantic_ratiodoubleOptional0-1Defaults to 0.5

Balance between semantic and keyword retrieval. Captain searches both ways at once: keyword (sparse, BM25) matches the words in the query, semantic (dense vector) matches its meaning. 0.0 is keyword only, 1.0 is semantic only, and 0.5 (the default) weighs them equally. Lower it for corpora full of exact terms such as part numbers or error codes; raise it when callers phrase questions in their own words. Between the endpoints both searches run, so a result found only by the down-weighted side still appears, just lower. The endpoints skip the other search entirely: 0.0 also skips embedding the query, making it the fastest option, though queries using boost and collections holding images, video, or audio keep vector search running. See the Advanced Querying guide for more.

Response

Successful Response
successboolean
querystring
search_resultslist of objects
total_resultsinteger
top_kinteger
warningslist of strings or nullOptional
tokens_usedmap from strings to integers or nullOptional
execution_time_msinteger or nullOptional
request_idstring or nullOptional
query_idstring or nullOptional

Id of this query in your history. Fetch it back with GET /v2/queries/{query_id}. Present when the query was stored (completed, non-streamed queries).

token_balanceobject or nullOptional
© 2026 Captain