软件版本
elasticsearch 6.8.6
JDK 1.8
___
**第一步 springboot 版本升级为2.2.0.RELEASE**
``` xml
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.RELEASE</version>
```
**第二步 修改配置文件**
``` yaml
spring:
elasticsearch:
rest:
username: elastic
password: hRnXw1VuvkixVn77uVHg
uris: http://127.0.0.1:9200
```
**第三步 修改代码**
将`ElasticsearchTemplate`修改为`ElasticsearchRestTemplate`。
`ElasticsearchRestTemplate`功能更加强大,可以定义更复杂的查询。
Springboot整合spring-data-elasticsearch 配置X-Pack