Table of Contents

Interface IIndexOperationsManager

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

Provides functionality for dynamic index operations including creation, optimization, and health monitoring.

public interface IIndexOperationsManager
Extension Methods

Methods

CreateIndexAsync(string, IndexConfiguration, CancellationToken)

Creates an index with the specified configuration.

Task<bool> CreateIndexAsync(string indexName, IndexConfiguration configuration, CancellationToken cancellationToken)

Parameters

indexName string

The name of the index to create.

configuration IndexConfiguration

The index configuration settings.

cancellationToken CancellationToken

The cancellation token to cancel the operation if required.

Returns

Task<bool>

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

DeleteIndexAsync(string, CancellationToken)

Deletes an index from Elasticsearch.

Task<bool> DeleteIndexAsync(string indexName, CancellationToken cancellationToken)

Parameters

indexName string

The name of the index to delete.

cancellationToken CancellationToken

The cancellation token to cancel the operation if required.

Returns

Task<bool>

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

GetIndexHealthAsync(string?, CancellationToken)

Gets health information for the specified indices.

Task<IEnumerable<IndexHealthStatus>> GetIndexHealthAsync(string? indexPattern, CancellationToken cancellationToken)

Parameters

indexPattern string

The index pattern to check. If null, checks all indices.

cancellationToken CancellationToken

The cancellation token to cancel the operation if required.

Returns

Task<IEnumerable<IndexHealthStatus>>

A Task<TResult> containing index health information.

IndexExistsAsync(string, CancellationToken)

Checks if an index exists in Elasticsearch.

Task<bool> IndexExistsAsync(string indexName, CancellationToken cancellationToken)

Parameters

indexName string

The name of the index to check.

cancellationToken CancellationToken

The cancellation token to cancel the operation if required.

Returns

Task<bool>

A Task<TResult> indicating whether the index exists.

UpdateIndexSettingsAsync(string, JsonElement, CancellationToken)

Updates index settings dynamically.

Task<bool> UpdateIndexSettingsAsync(string indexName, JsonElement settingsJson, CancellationToken cancellationToken)

Parameters

indexName string

The name of the index to update.

settingsJson JsonElement

The new settings to apply 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.