Table of Contents

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

selection MailboxEmailSelection

Which emails are eligible before any distance is measured.

queryText EmailSearchQueryText

The validated free text to place in the vector space.

limit int

The greatest number of candidates to return, at least one.

cancellationToken CancellationToken

Propagates 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 selection or queryText is null.

ArgumentOutOfRangeException

Thrown when limit is 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.