Skip to Content

The EmailSearchResult type of the TypeScript SDK, which search.query take or answer.

type EmailSearchResult = {
  ids?: string[]
  limit?: number
  position: number
  results: MessageMeta[]
  scanWindow?: number
  snippets?: EmailSearchSnippet[]
  total?: number
  truncated?: boolean
}

Fields

FieldTypeDescription
idsstring[]Optional. With fields: "ids": the matching message IDs in query order (results is then empty)
limitnumberOptional. Effective page size limit applied by the server
positionnumberZero-based index of the first result within total matches
resultsMessageMeta[]List of matching messages for the current page
scanWindownumberOptional. The cap that clipped: the collapsed results were drawn from the newest this-many matching messages. Present only beside truncated, so a client can say "more than N matches" with the N the server applied.
snippetsEmailSearchSnippet[]Optional. List of search term highlighted snippets for results
totalnumberOptional. Total number of matching messages (when calculateTotal was true)
truncatedbooleanOptional. Present (true) only on a collapseThreads query whose scan hit the server's row cap: the collapsed result set covers the newest matches, not all of them, and positional paging ends when that set does even though total (when requested) counts the whole match set. Present on EVERY page of such a query, not only the last, so a client can say so from page one.

Used by

MethodWhat it does
search.queryStructured filter and query messages

On this page