use of co.elastic.clients.elasticsearch.indices.CreateIndexResponse in project syncope by apache.
the class ElasticsearchIndexManager method createIndex.
public void createIndex(final String domain, final AnyTypeKind kind, final IndexSettings settings, final TypeMapping mappings) throws IOException {
try {
CreateIndexResponse response = doCreateIndex(domain, kind, settings, mappings);
LOG.debug("Successfully created {} for {}: {}", ElasticsearchUtils.getContextDomainName(domain, kind), kind.name(), response);
} catch (ElasticsearchException e) {
LOG.debug("Could not create index {} because it already exists", ElasticsearchUtils.getContextDomainName(domain, kind), e);
removeIndex(domain, kind);
doCreateIndex(domain, kind, settings, mappings);
}
}
Aggregations