co.elastic.clients.elasticsearch._types.ElasticsearchException: [es/indices.create] failed: [resource_already_exists_exception] index [[test1111/OvwpReOdTNa-44HKedMUrw]]already exists

Create index use elasticsearchClient.indices() , Executed Exception:co.elastic.clients.elasticsearch._types.ElasticsearchException: [es/indices.create] failed:[resource_already_exists_exception] index [test12345/OvwpReOdTNa-44HKedMUrw] already exists

Elasticsearch 7.17.3 ,
Technology stack use Elasticsearch Java Api Client

Code:
Map<String, Property> propertyMap = new HashMap<>();
propertyMap.put("id", new Property(new LongNumberProperty.Builder().index(true).store(true).build()));
propertyMap.put("name", new Property(new TextProperty.Builder().index(true).analyzer("ik_max_word").store(true).build()));
CreateIndexResponse response = elasticsearchClient.indices().create(x -> x
.index(indexName)
.settings(f -> f.numberOfReplicas("1").numberOfShards("2"))
.mappings(m -> {
m.properties(maps);
return m;
})
);

Welcome to our community! :smiley:

It looks like that index already exists, so it cannot create it again.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.