Table of Contents

Class PostgresTextSearchConfiguration

Namespace
MailFathom.Infrastructure.Persistence.Connections
Assembly
MailFathom.Infrastructure.dll

Names the PostgreSQL text search configuration the lexical index is built with.

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

Remarks

The configuration is stated rather than left to the server's default_text_search_config for two reasons. It decides how every indexed word is stemmed and which words are dropped as stop words, so changing it changes what the index contains rather than only how a query is written; a value inherited from a session setting could differ between the process that wrote a row and the one that queries it, and the mismatch would show up as missing search results rather than as an error. The single-argument to_tsvector is also not immutable for exactly that reason, so PostgreSQL refuses it in the generated column this value exists to build.

The name is interpolated into that column's definition, which is why it is checked against a closed set instead of being pattern-matched. A configuration outside the set is refused rather than passed through: an unknown name would either fail schema creation at a point far from the configuration mistake, or — for a name that does exist but was not meant — silently index the whole mailbox under the wrong language.

Properties

Default

Gets the configuration used when a deployment names none.

SupportedNames

Gets the names a deployment may configure, in the order they are reported to an operator.

Value

Gets the configuration name as PostgreSQL knows it.

Methods

Create(string)

Creates a configuration from a supported name.

IsSupported(string?)

Reports whether a configured name is one MailFathom accepts.

ToString()

Returns a string that represents the current object.