ElasticsearchIndexInitializer

abstract class ElasticsearchIndexInitializer(elasticsearchClient: ReactiveElasticsearchClient, resourceLocator: WowResourceLocator, namedAggregates: Iterable<NamedAggregate>, indexNaming: ElasticsearchIndexNaming)

Creates the concrete Elasticsearch indices whose definitions an application ships: for each aggregate, META-INF/wow/elasticsearch/{indexName}.json on the classpath or config/wow/elasticsearch/{indexName}.json in the working directory, a native create-index request (settings, mappings, aliases). An index that does not exist yet is created from it; the index templates matching its name still apply beneath it, the definition winning where both map a field. The definition is found under the index's unprefixed name and creates the index indexNaming names.

An existing index keeps its mapping: Wow never changes it. When the mapping differs from its definition at a path the definition maps (an index created from the templates alone, before the definition shipped), startup logs a warning naming those paths, since queries on them are refused or answer from a mapping the application did not intend.

Inheritors

Constructors

Link copied to clipboard
constructor(elasticsearchClient: ReactiveElasticsearchClient, resourceLocator: WowResourceLocator, namedAggregates: Iterable<NamedAggregate>, indexNaming: ElasticsearchIndexNaming)
constructor(elasticsearchClient: ReactiveElasticsearchClient, resourceLocator: WowResourceLocator, namedAggregates: Iterable<NamedAggregate>)

The constructor from before the index prefix, kept for binary compatibility: Wow's unprefixed names.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun ensureAll(): Mono<Void>