Spring Data Elasticsearch 、Elasticsearch服务器、Spring Boot这三个版本号必须要一致才行,不然会有各种报错
pom.xml 中MAVEN引用
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.3.6.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent>
<!--引入elasticsearch-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
官网版本对应说明