Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Spring Data support Elasticsearch 5.x?

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

like image 436
khateeb Avatar asked Feb 02 '17 12:02

khateeb


People also ask

Does spring data support Elasticsearch?

The Spring Data Elasticsearch project provides integration with the Elasticsearch search engine. Key functional areas of Spring Data Elasticsearch are a POJO centric model for interacting with a Elastichsearch Documents and easily writing a Repository style data access layer.

Why ElasticsearchTemplate is deprecated?

The ElasticsearchTemplate class is deprecated as it uses the TransportClient to access Elasticsearch, which itself is deprecated since Elasticsearch version 7. + Users should switch to ElasticsearchRestTemplate or ReactiveElasticsearchTemplate .

What is Elasticsearch in spring?

Elasticsearch is built on top of Apache Lucene and was first released by Elasticsearch N.V. (now Elastic) in 2010. According to the website of Elastic, it is a distributed open-source search and analytics engine for all types of data, including textual, numerical, geospatial, structured, and unstructured.

Is Elasticsearch reactive?

ElasticSearch is well known as a search engine, also working well as document based NoSQL. Spring Data ElasticSearch adds basic Reactive support. Generate a project skeleton from Spring Intializr. Create a Post class to present a document in ElasticSearch, and add a @Document annotation on the class level.


2 Answers

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.

like image 22
misbah Avatar answered Sep 28 '22 10:09

misbah


Not support yet, you can try ES native java api.

like image 94
YANGLiN Avatar answered Sep 28 '22 10:09

YANGLiN