Elasticsearch Spring Data with RestHighLevelClient
Asked Answered
S

3

8

I don't understand the relationship between the High Level REST CLient (which replaces the Transport Client) and Spring Data Elasticsearch.

There are tutorials (https://www.baeldung.com/spring-data-elasticsearch-tutorial) showing how to make JPA-style queries with auto-implemented methods like getSomethingById(). They utilize this interface:

public interface ElasticsearchRepository<T, ID extends Serializable> extends ElasticsearchCrudRepository<T, ID> {

But ElasticsearchRepository seems to require a @Configuration-Class with an ElasticsearchTemplate-Bean and that requires the TransportClient. As far as I have tried out, there is no way of replacing it with the High/Low Level Java Rest Clients, no?

So if I want to use the newest official Client, there is no JPA-goodness for me?

Shabbir answered 15/8, 2018 at 4:47 Comment(3)
There's an open issue regarding this in the Spring Data ES repo: jira.spring.io/browse/DATAES-407Khamsin
@Khamsin Thank you very much! I also appreciated your answer for this question: #49173125 Really useful information there!Shabbir
@Khamsin can you please post your comment as answer. I'm tired of reading questions that are already answered in the comments.Precursory
K
5

There's an open issue regarding this in the Spring Data ES repo: https://jira.spring.io/browse/DATAES-407

Khamsin answered 15/8, 2018 at 7:6 Comment(2)
seems that 3.2 M1 includes the porting toward High Level REST Client; ipiii :)Toinette
@adrhc looks like the 3.2 M1 release is delayed. It was scheduled to release in Dec 2018Staunch
M
1

spring-data-elasticsearch 3.2.0, now available as M2 contains the code to use the RestClient.

See my answer to this question: What Elasticsearch client does Spring-Data-Elasticsearch use under the hood? for how to set it up

Miscreated answered 3/4, 2019 at 21:46 Comment(0)
T
0

Spring Data Moore has been release including this feature (October 8 2019).This is the main description:

Elasticsearch: High Level REST Client support & non Jackson based entity mapping

If yo need more detail You will be able to have a look to this jira issue:

https://jira.spring.io/browse/DATAES-407 for more detail

Tailing answered 14/10, 2019 at 10:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.