SearchRan
TypeWhat a search actually ran, as opposed to what was asked for: mode, hybrid, whether it reranked, and the pipeline version.
Returned as mode alongside a search's results, this describes what the search actually did rather than what you asked for. It is worth checking when a result surprises you: an omitted mode on the request falls back to the corpus's configuration, and reranked is false when reranking was skipped or failed open. It is absent only when the corpus does not exist yet, in which case nothing ran.
SearchRan.ts
interface SearchRan { search: 'hybrid' | 'semantic' | 'lexical' hybrid: boolean reranked: boolean pipelineVersion: number }
Fields
search
enum
The retrieval mode that ran.
hybrid
boolean
Whether keyword matching ran alongside semantic.
reranked
boolean
Whether reranking ran. False when it was skipped or failed open.
pipelineVersion
number
Which build served the query. Changes when a re-vectorization is promoted.
Check what ran
const { results, mode } = await Policies.search(q); if (mode && !mode.reranked) console.warn('reranking was skipped');