Table of Contents

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

initializers IEnumerable<IInitializeElasticIndex>

A collection of objects that implement the IInitializeElasticIndex interface, each responsible for initializing specific Elasticsearch indexes.

Exceptions

ArgumentNullException

Thrown if initializers is null .

Methods

InitializeIndexesAsync()

Initializes all Elasticsearch indexes by invoking the InitializeAsync(CancellationToken) method on each registered initializer.

public Task InitializeIndexesAsync()

Returns

Task

A Task representing the asynchronous initialization operation.

Remarks

This method iterates through all registered IInitializeElasticIndex instances and ensures that each one is executed sequentially.