问题
Does the latest version of Spring Data (2.1.0.RELEASE or 3.0.0M1) support Elasticsearch 5.x? If not, When will it support it?
There is no information about this in their docs: Spring Data Elasticsearch
回答1:
Not support yet, you can try ES native java api.
回答2:
Yes, now spring-data supports Elasticsearch v5.x. It's not supported with RELEASE version, it's supported with BUILD-SNAPSHOT version. To use it, you have to add repository URL as well. For maven project, build script will look something like-
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>3.0.0.BUILD-SNAPSHOT</version>
</dependency>
<repository>
<id>spring-libs-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>http://repo.spring.io/libs-snapshot</url>
</repository>
For detail information, you can visit https://github.com/spring-projects/spring-data-elasticsearch
N.B. While writing this answer, latest version of elasticsearch and spring-data-elasticsearch was 5.4.2 and 3.0.0.BUILD-SNAPSHOT respectively. Those two were compatible.
来源:https://stackoverflow.com/questions/42001828/does-spring-data-support-elasticsearch-5-x