Search in sources :

Example 6 with IgnoreIndexTemplate

use of org.graylog2.indexer.IgnoreIndexTemplate in project graylog2-server by Graylog2.

the class IndexMappingFactory method createIndexMapping.

@Nonnull
public IndexMappingTemplate createIndexMapping(@Nonnull IndexSetConfig indexSetConfig) throws IgnoreIndexTemplate {
    final SearchVersion elasticsearchVersion = node.getVersion().orElseThrow(() -> new ElasticsearchException("Unable to retrieve Elasticsearch version."));
    final String templateType = indexSetConfig.indexTemplateType().orElse(IndexSetConfig.DEFAULT_INDEX_TEMPLATE_TYPE);
    return resolveIndexMappingTemplateProvider(templateType).create(elasticsearchVersion, indexSetConfig);
}
Also used : SearchVersion(org.graylog2.storage.SearchVersion) Nonnull(javax.annotation.Nonnull)

Aggregations

IgnoreIndexTemplate (org.graylog2.indexer.IgnoreIndexTemplate)5 Test (org.junit.jupiter.api.Test)3 IndexTemplateNotFoundException (org.graylog2.indexer.IndexTemplateNotFoundException)2 Nonnull (javax.annotation.Nonnull)1 IndexMappingFactory (org.graylog2.indexer.IndexMappingFactory)1 IndexSetConfig (org.graylog2.indexer.indexset.IndexSetConfig)1 SearchVersion (org.graylog2.storage.SearchVersion)1