Table of Contents

Method EnsureBuiltAsync

Namespace
MailFathom.Application.Emails.Embeddings.Indexing
Assembly
MailFathom.Application.dll

EnsureBuiltAsync(ActiveEmbeddingProfile, CancellationToken)

Builds the approximate index for one profile, leaving an existing one in place.

Task EnsureBuiltAsync(ActiveEmbeddingProfile profile, CancellationToken cancellationToken)

Parameters

profile ActiveEmbeddingProfile

The profile whose vectors the index serves, and whose geometry decides its shape.

cancellationToken CancellationToken

Cancels the build.

Returns

Task

A task that completes when the profile has its index.

Remarks

Idempotent, so activating a profile that already has its index builds nothing and does not fail. A profile's identity is immutable and the index is named after that identity, so an index already carrying the name is the index this call would have built rather than a differently shaped one wearing the same name.

Exceptions

ArgumentNullException

Thrown when profile is null.

EmbeddingVectorIndexFailedException

Thrown when the database refused to build the index.