Skip to Content

The SemanticSearchResult type of the TypeScript SDK, which search.semantic take or answer.

type SemanticSearchResult = {
  coverage: SemanticCoverage
  fused: boolean
  nextCursor?: string
  results: MessageMeta[]
  scoped?: 'candidate-bounded'
  snippets?: EmailSearchSnippet[]
}

Fields

FieldTypeDescription
coverageSemanticCoverage
fusedbooleanTrue when the lexical (BM25) ranking was fused in by reciprocal rank (hybrid): the default, and FORCED whenever a DO-side filter such as label is given, because the semantic candidate list is bounded at 100 before that filter and a narrow scope would otherwise starve
nextCursorstringOptional. Opaque cursor for the next page; absent on the last page
resultsMessageMeta[]
scoped'candidate-bounded'Optional. Present when a post-filter (label) narrowed a candidate list that is bounded at 100 before filtering: the semantic half may have missed matches that rank past 100; the fused lexical half is what keeps the answer honest
snippetsEmailSearchSnippet[]Optional. Highlighted excerpts (snippet=true)

Used by

MethodWhat it does
search.semanticSemantic (meaning-based) search of a mailbox

On this page