Table of Contents

Interface IIndexAliasManager

Namespace
Excalibur.Data.ElasticSearch.IndexManagement
Assembly
Excalibur.Data.ElasticSearch.dll

Provides functionality for managing Elasticsearch index aliases.

public interface IIndexAliasManager

Methods

AliasExistsAsync(string, CancellationToken)

Checks if an alias exists in Elasticsearch.

Task<bool> AliasExistsAsync(string aliasName, CancellationToken cancellationToken)

Parameters

aliasName string

The name of the alias to check.

cancellationToken CancellationToken

The cancellation token to cancel the operation if required.

Returns

Task<bool>

A Task<TResult> indicating whether the alias exists.

CreateAliasAsync(string, IEnumerable<string>, JsonElement?, CancellationToken)

Creates or updates an alias for the specified indices.

Task<bool> CreateAliasAsync(string aliasName, IEnumerable<string> indexNames, JsonElement? aliasConfigurationJson, CancellationToken cancellationToken)

Parameters

aliasName string

The name of the alias.

indexNames IEnumerable<string>

The names of the indices to include in the alias.

aliasConfigurationJson JsonElement?

Optional alias configuration settings as opaque JSON.

cancellationToken CancellationToken

The cancellation token to cancel the operation if required.

Returns

Task<bool>

A Task<TResult> indicating whether the operation was successful.

DeleteAliasAsync(string, IEnumerable<string>?, CancellationToken)

Deletes an alias from Elasticsearch.

Task<bool> DeleteAliasAsync(string aliasName, IEnumerable<string>? indexNames, CancellationToken cancellationToken)

Parameters

aliasName string

The name of the alias to delete.

indexNames IEnumerable<string>

The names of the indices to remove the alias from. If null, removes from all indices.

cancellationToken CancellationToken

The cancellation token to cancel the operation if required.

Returns

Task<bool>

A Task<TResult> indicating whether the operation was successful.

GetAliasesAsync(string?, CancellationToken)

Gets all aliases that match the specified pattern.

Task<IEnumerable<AliasDefinition>> GetAliasesAsync(string? aliasPattern, CancellationToken cancellationToken)

Parameters

aliasPattern string

The pattern to match alias names against. If null, returns all aliases.

cancellationToken CancellationToken

The cancellation token to cancel the operation if required.

Returns

Task<IEnumerable<AliasDefinition>>

A Task<TResult> containing the matching aliases.

UpdateAliasesAsync(IEnumerable<AliasOperation>, CancellationToken)

Performs atomic alias operations to switch indices behind an alias.

Task<bool> UpdateAliasesAsync(IEnumerable<AliasOperation> operations, CancellationToken cancellationToken)

Parameters

operations IEnumerable<AliasOperation>

The alias operations to perform atomically.

cancellationToken CancellationToken

The cancellation token to cancel the operation if required.

Returns

Task<bool>

A Task<TResult> indicating whether the operation was successful.