spring:
elasticsearch:
rest:
uris: http://xxoo:9200
password: xxoo
username: elastic
data:
elasticsearch:
client:
reactive:
username: elastic
password: xxoo
endpoints: xxoo:9200
@Bean
public ReactiveElasticsearchTemplate reactiveElasticsearchTemplate(ReactiveElasticsearchClient client) {
return new ReactiveElasticsearchTemplate(client);
}
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!-- elasticsearch -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>