DATAES-826 - Repositories should not try to create an index when it already exists.

original PR: #456
This commit is contained in:
Peter-Josef Meisch 2020-05-14 18:05:03 +02:00 committed by GitHub
parent 7540a2a1a8
commit c7339dc248
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,7 +88,7 @@ public abstract class AbstractElasticsearchRepository<T, ID> implements Elastics
this.entityClass = this.entityInformation.getJavaType(); this.entityClass = this.entityInformation.getJavaType();
this.indexOperations = operations.indexOps(this.entityClass); this.indexOperations = operations.indexOps(this.entityClass);
try { try {
if (createIndexAndMapping()) { if (createIndexAndMapping() && !indexOperations.exists()) {
createIndex(); createIndex();
putMapping(); putMapping();
} }