Table of Contents

Interface IIndexTemplateManager

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

Provides functionality for managing Elasticsearch index templates including creation, updates, and validation.

public interface IIndexTemplateManager
Extension Methods

Methods

CreateOrUpdateTemplateAsync(string, IndexTemplateConfiguration, CancellationToken)

Creates or updates an index template in Elasticsearch.

Task<bool> CreateOrUpdateTemplateAsync(string templateName, IndexTemplateConfiguration template, CancellationToken cancellationToken)

Parameters

templateName string

The name of the index template.

template IndexTemplateConfiguration

The template configuration.

cancellationToken CancellationToken

The cancellation token to cancel the operation if required.

Returns

Task<bool>

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

DeleteTemplateAsync(string, CancellationToken)

Deletes an index template from Elasticsearch.

Task<bool> DeleteTemplateAsync(string templateName, CancellationToken cancellationToken)

Parameters

templateName string

The name of the index template 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.

GetTemplatesAsync(string?, CancellationToken)

Gets all index templates that match the specified pattern.

Task<IEnumerable<IndexTemplateDescriptor>> GetTemplatesAsync(string? namePattern, CancellationToken cancellationToken)

Parameters

namePattern string

The pattern to match template names against. If null, returns all templates.

cancellationToken CancellationToken

The cancellation token to cancel the operation if required.

Returns

Task<IEnumerable<IndexTemplateDescriptor>>

A Task<TResult> containing the matching templates.

TemplateExistsAsync(string, CancellationToken)

Checks if an index template exists in Elasticsearch.

Task<bool> TemplateExistsAsync(string templateName, CancellationToken cancellationToken)

Parameters

templateName string

The name of the index template to check.

cancellationToken CancellationToken

The cancellation token to cancel the operation if required.

Returns

Task<bool>

A Task<TResult> indicating whether the template exists.

ValidateTemplateAsync(IndexTemplateConfiguration, CancellationToken)

Validates an index template configuration without applying it.

Task<TemplateValidationResult> ValidateTemplateAsync(IndexTemplateConfiguration template, CancellationToken cancellationToken)

Parameters

template IndexTemplateConfiguration

The template configuration to validate.

cancellationToken CancellationToken

The cancellation token to cancel the operation if required.

Returns

Task<TemplateValidationResult>

A Task<TResult> containing validation results.