Method ReadWrittenMatchesAsync
- Namespace
- MailFathom.Application.Emails.Search.Attachments
- Assembly
- MailFathom.Application.dll
ReadWrittenMatchesAsync(MailboxEmailSelection, EmailSearchQueryText, EmailSearchSnippetBounds, IReadOnlyList<StoredEmailId>, CancellationToken)
Reads the passages of document attachments the query's own words reached, inside a ranked window.
Task<IReadOnlyList<StoredEmailAttachmentMatches>> ReadWrittenMatchesAsync(MailboxEmailSelection selection, EmailSearchQueryText queryText, EmailSearchSnippetBounds snippetBounds, IReadOnlyList<StoredEmailId> rankedEmailIds, CancellationToken cancellationToken)
Parameters
selectionMailboxEmailSelectionThe same filters the window was ranked under.
queryTextEmailSearchQueryTextThe validated free text the extracts are cut around.
snippetBoundsEmailSearchSnippetBoundsHow many extracts one message may show, and how long each may be.
rankedEmailIdsIReadOnlyList<StoredEmailId>The window to read, in any order.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task<IReadOnlyList<StoredEmailAttachmentMatches>>
One entry per message whose attachments matched, each carrying at most SnippetsPerEmail passages.
Remarks
A message whose attachments matched nothing is absent rather than present and empty, and so is an attachment MailFathom could not read — encrypted, corrupt, unsupported, carrying no text layer, or excluded by format. There is no searched-and-empty state here: what the reason was lives on the attachment's own row, which is where a user asking why is answered.
Exceptions
- ArgumentNullException
Thrown when any reference argument is null.