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
templateNamestringThe name of the index template.
templateIndexTemplateConfigurationThe template configuration.
cancellationTokenCancellationTokenThe 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
templateNamestringThe name of the index template to delete.
cancellationTokenCancellationTokenThe 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
namePatternstringThe pattern to match template names against. If null, returns all templates.
cancellationTokenCancellationTokenThe 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
templateNamestringThe name of the index template to check.
cancellationTokenCancellationTokenThe 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
templateIndexTemplateConfigurationThe template configuration to validate.
cancellationTokenCancellationTokenThe cancellation token to cancel the operation if required.
Returns
- Task<TemplateValidationResult>
A Task<TResult> containing validation results.