|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright 2012-2020 the original author or authors.
|
|
|
|
|
* Copyright 2012-2021 the original author or authors.
|
|
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
@ -17,7 +17,6 @@
|
|
|
|
|
package org.springframework.boot.autoconfigure.data.elasticsearch;
|
|
|
|
|
|
|
|
|
|
import org.elasticsearch.action.support.IndicesOptions;
|
|
|
|
|
import org.elasticsearch.action.support.WriteRequest;
|
|
|
|
|
import org.elasticsearch.client.RestHighLevelClient;
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
|
|
|
@ -30,6 +29,7 @@ import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
|
|
|
|
|
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
|
|
|
|
|
import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations;
|
|
|
|
|
import org.springframework.data.elasticsearch.core.ReactiveElasticsearchTemplate;
|
|
|
|
|
import org.springframework.data.elasticsearch.core.RefreshPolicy;
|
|
|
|
|
import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter;
|
|
|
|
|
import org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter;
|
|
|
|
|
import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext;
|
|
|
|
@ -87,7 +87,7 @@ abstract class ElasticsearchDataConfiguration {
|
|
|
|
|
ElasticsearchConverter converter) {
|
|
|
|
|
ReactiveElasticsearchTemplate template = new ReactiveElasticsearchTemplate(client, converter);
|
|
|
|
|
template.setIndicesOptions(IndicesOptions.strictExpandOpenAndForbidClosed());
|
|
|
|
|
template.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
|
|
|
|
|
template.setRefreshPolicy(RefreshPolicy.IMMEDIATE);
|
|
|
|
|
return template;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|