Class IndexInitializer
- Namespace
- Excalibur.Data.ElasticSearch
- Assembly
- Excalibur.Data.ElasticSearch.dll
Provides functionality to initialize Elasticsearch indexes by delegating the operation to registered initializers.
public sealed class IndexInitializer : IIndexInitializer
- Inheritance
-
IndexInitializer
- Implements
- Inherited Members
Constructors
IndexInitializer(IEnumerable<IInitializeElasticIndex>)
Initializes a new instance of the IndexInitializer class.
public IndexInitializer(IEnumerable<IInitializeElasticIndex> initializers)
Parameters
initializersIEnumerable<IInitializeElasticIndex>A collection of objects that implement the IInitializeElasticIndex interface, each responsible for initializing specific Elasticsearch indexes.
Exceptions
- ArgumentNullException
Thrown if
initializersisnull.
Methods
InitializeIndexesAsync()
Initializes all Elasticsearch indexes by invoking the InitializeAsync(CancellationToken) method on each registered initializer.
public Task InitializeIndexesAsync()
Returns
Remarks
This method iterates through all registered IInitializeElasticIndex instances and ensures that each one is executed sequentially.