Method FindNearestCandidatesAsync
- Namespace
- MailFathom.Application.Emails.Search
- Assembly
- MailFathom.Application.dll
FindNearestCandidatesAsync(MailboxEmailSelection, EmailSearchQueryText, int, CancellationToken)
Ranks the eligible mail by how near it sits to what the query means.
public Task<SemanticEmailSearchOutcome> FindNearestCandidatesAsync(MailboxEmailSelection selection, EmailSearchQueryText queryText, int limit, CancellationToken cancellationToken)
Parameters
selectionMailboxEmailSelectionWhich emails are eligible before any distance is measured.
queryTextEmailSearchQueryTextThe validated free text to place in the vector space.
limitintThe greatest number of candidates to return, at least one.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task<SemanticEmailSearchOutcome>
What semantic retrieval could do for this query, and the ranking when it could produce one.
Exceptions
- ArgumentNullException
Thrown when
selectionorqueryTextis null.- ArgumentOutOfRangeException
Thrown when
limitis below one.- OperationCanceledException
Thrown when the caller cancels or the host is shutting down, which is neither a provider failure nor an absence of semantic retrieval.