Class EmailSearchQueryText
- Namespace
- MailFathom.Application.Emails.Search
- Assembly
- MailFathom.Application.dll
The free text a caller is searching their mail for.
public sealed record EmailSearchQueryText : IEquatable<EmailSearchQueryText>
- Inheritance
-
EmailSearchQueryText
- Implements
- Inherited Members
Remarks
The text is bounded and checked for characters no document could hold, and then travels to PostgreSQL as a parameter that the full-text parser turns into a query — so a caller's operators, quotes, and punctuation are data the parser reads rather than syntax anything composes with. Where any word matches, the text is split into its words, quoted phrases, and excluded terms first, and what travels is those terms rejoined, still as a parameter. Nothing in this type or below it concatenates the value into SQL.
It is a type of its own rather than a string parameter because it is the one untrusted value that reaches a query as text. A named type means the bound and the refusal are stated once, and a reader of the port signature can see that the text arriving there is the validated one.
Query text is personal data of a particularly revealing kind — what somebody is looking for in their own mailbox — so it is never logged and never repeated in a failure message.
Fields
- MatchingDescription
How the words of a query are matched, written for whoever writes one.
- MaximumLength
The greatest number of characters a search query may carry.
Properties
- ExcludedText
Gets the text
websearch_to_tsqueryreads for the messages a search must not match, or null where it excludes nothing.
- MatchedText
Gets the text
websearch_to_tsqueryreads for the messages a search matches.
- Value
Gets the query text as the caller wrote it, validated.
- WordMatching
Gets how the words of the query decide what the full-text index matches.
Methods
- Create(string?)
Validates and normalizes the text a request asked to search for.
- MatchedUnder(EmailSearchRetrievalMode)
Gets this query as a search ranking the given way matches it.
- ToString()
Returns a string that represents the current object.