SearchHit
TypeOne ranked result: a matched passage, its relevance score, and a citation to its source.
A single result from search, carrying score, text, and citation, plus the pre-rerank retrievalRank and retrievalScore so you can see what reranking moved. Three further fields are additive and appear only when requested: explain when explaining, neighbors when expanding, and matches when highlighting. None of them change the results or their order.
SearchHit.ts
interface SearchHit { score: number text: string citation: Citation retrievalRank?: number retrievalScore?: number explain?: SearchExplain neighbors?: { before: string[]; after: string[] } matches?: { start: number; end: number; token: string }[] }
Fields
score
number
Relevance of the hit, comparable within a response but not across them. With reranking on it is the reranker's 0 to 1 relevance, the one scale that stays stable across modes and the right place for a quality cutoff. With reranking off it is the raw retrieval score, whose scale depends on the mode: cosine similarity in semantic, an RRF rank reciprocal in hybrid (small numbers that are not similarities), a keyword-overlap weight in lexical.
text
string
The matched chunk, prefixed with its heading path for context.
citation
Where the passage came from. Always render it.
retrievalRank?
number
Where retrieval put this hit before reranking. Compare with its final position to see what reranking did.
retrievalScore?
number
The retriever's own score, kept apart from the reranker's.
explain?
SearchExplain
On requestWhich retrieval branch found the hit. Only when explain was requested.
neighbors?
{ before, after }
On requestChunks either side of the hit, for showing it in context. Only when expand was requested.
matches?
{ start, end, token }[]
On requestOffsets of the query's distinctive terms in text, for highlighting. Only when highlight was requested.
Render a hit
const { results } = await Policies.search(q); results.map((hit) => ({ text: hit.text, source: hit.citation.url, jumped: hit.retrievalRank, // vs its final position }));