mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-29 15:22:11 +00:00
Polishing.
This commit is contained in:
parent
7f178238db
commit
33973ec839
@ -83,11 +83,16 @@ public class SimpleElasticsearchRepository<T, ID> implements ElasticsearchReposi
|
|||||||
this.indexOperations = operations.indexOps(this.entityClass);
|
this.indexOperations = operations.indexOps(this.entityClass);
|
||||||
|
|
||||||
if (!"true".equals(System.getenv("SPRING_DATA_ELASTICSEARCH_SKIP_REPOSITORY_INIT"))) {
|
if (!"true".equals(System.getenv("SPRING_DATA_ELASTICSEARCH_SKIP_REPOSITORY_INIT"))) {
|
||||||
if (shouldCreateIndexAndMapping() && !indexOperations.exists()) {
|
createIndexAndMappingIfNeeded();
|
||||||
indexOperations.createWithMapping();
|
}
|
||||||
} else if (shouldAlwaysWriteMapping()) {
|
}
|
||||||
indexOperations.putMapping();
|
|
||||||
}
|
public void createIndexAndMappingIfNeeded() {
|
||||||
|
|
||||||
|
if (shouldCreateIndexAndMapping() && !indexOperations.exists()) {
|
||||||
|
indexOperations.createWithMapping();
|
||||||
|
} else if (shouldAlwaysWriteMapping()) {
|
||||||
|
indexOperations.putMapping();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ public class SimpleReactiveElasticsearchRepository<T, ID> implements ReactiveEla
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createIndexAndMappingIfNeeded() {
|
public void createIndexAndMappingIfNeeded() {
|
||||||
|
|
||||||
var blockingIndexOperations = blocking(indexOperations);
|
var blockingIndexOperations = blocking(indexOperations);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user