Skip to content

Commit c7339dc

Browse files
authored
DATAES-826 - Repositories should not try to create an index when it already exists.
original PR: spring-projects#456
1 parent 7540a2a commit c7339dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/springframework/data/elasticsearch/repository/support/AbstractElasticsearchRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public AbstractElasticsearchRepository(ElasticsearchEntityInformation<T, ID> met
8888
this.entityClass = this.entityInformation.getJavaType();
8989
this.indexOperations = operations.indexOps(this.entityClass);
9090
try {
91-
if (createIndexAndMapping()) {
91+
if (createIndexAndMapping() && !indexOperations.exists()) {
9292
createIndex();
9393
putMapping();
9494
}

0 commit comments

Comments
 (0)