Table of Contents

Class EmailKnowledgeQuery

Namespace
MailFathom.Application.Retrieval
Assembly
MailFathom.Application.dll

What one lookup of an answering run asks for: the text to rank against, and the narrowing written beside it.

public sealed record EmailKnowledgeQuery : IEquatable<EmailKnowledgeQuery>
Inheritance
EmailKnowledgeQuery
Implements
Inherited Members

Remarks

Every field here is written by a model, and the type exists so that a run can express what a caller of search_emails expresses. A question that is naturally a filter — mail from one person, mail of one week, mail that carries an attachment — is otherwise answerable only by ranking free text across the whole scope, which is the one shape lexical and vector similarity are both weakest at.

The fields are deliberately the structured filters of SearchEmailsRequest and no others. That request's remaining members are withheld rather than omitted by accident, and each for its own reason:

  • The accounts and folders are the caller's authorization, so they travel beside a query rather than inside one. A model writes queries and never its own boundary, which is what keeps the scope unreachable from anything an instruction, a retrieved message, or a tool argument can say.
  • Whether the junk folder is read at all is settled when that scope is resolved rather than by a lookup, and an answering run resolves it excluded. Answering is the path the exclusion exists for — mail written to manipulate whoever reads it now has a model reading it — and a caller hunting a wrongly filed message reaches for the listing or the search that can ask for it.
  • The result count is the deployment's bound on how much mail one lookup may draw out. Exposing it would let the one party with an incentive to ask for more mail ask for more mail, so the bound is applied where the passages are built and nothing about a query can widen it.

That list is asserted rather than trusted. A test names the withheld members and compares the two types' properties against them, because the filters this type mirrors are added to a published request by work that has no reason to read this file — which is how the two drifted apart before, with these remarks stating a parity that no longer held.

Nothing here is validated. The values reach the same use case that validates the published tool's, so a filter this system would refuse from a caller is refused from a model in the same words and by the same code.

Properties

HasAttachments

Gets whether attachments are required, or null for either.

IsRemotelyFlagged

Gets the remote \Flagged state to require, or null for either.

IsRemotelySeen

Gets the remote \Seen state to require, or null for either.

Keyword

Gets the keyword an email must carry, in any case, or null for any keyword.

QueryText

Gets the text to rank the eligible mail against.

ReceivedBefore

Gets the exclusive end of the received range, or null for no end.

ReceivedOnOrAfter

Gets the inclusive start of the received range, or null for no start.

RecipientAddress

Gets the address a To or Cc recipient must carry, or null for any recipient.

SenderAddress

Gets the address the sender must carry, in any case, or null for any sender.

SubjectFragment

Gets the fragment the subject must contain, compared without regard to case, or null for any subject.

Methods

ForText(string)

Builds a lookup that carries text and no narrowing.