简体   繁体   English

带有 RestHighLevelClient 的 Elasticsearch Spring 数据

[英]Elasticsearch Spring Data with RestHighLevelClient

I don't understand the relationship between the High Level REST CLient (which replaces the Transport Client) and Spring Data Elasticsearch.我不明白高级 REST 客户端(取代传输客户端)和 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().有教程 ( https://www.baeldung.com/spring-data-elasticsearch-tutorial ) 展示了如何使用 getSomethingById() 等自动实现的方法进行 JPA 样式的查询。 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.但是ElasticsearchRepository似乎需要一个带有 ElasticsearchTemplate-Bean 的@Configuration -Class 并且需要 TransportClient。 As far as I have tried out, there is no way of replacing it with the High/Low Level Java Rest Clients, no?据我尝试,没有办法用高/低级 Java Rest 客户端替换它,不是吗?

So if I want to use the newest official Client, there is no JPA-goodness for me?那么如果我想使用最新的官方客户端,对我来说没有JPA-goodness吗?

在Spring Data ES回购中有一个关于这个问题的公开问题: https//jira.spring.io/browse/DATAES-407

spring-data-elasticsearch 3.2.0, now available as M2 contains the code to use the RestClient. spring-data-elasticsearch 3.2.0,现在可以作为M2包含使用RestClient的代码。

See my answer to this question: What Elasticsearch client does Spring-Data-Elasticsearch use under the hood? 请参阅我对这个问题的回答: Spring-Data-Elasticsearch使用Elasticsearch客户端做什么? for how to set it up 如何设置它

Spring Data Moore has been release including this feature (October 8 2019).This is the main description: Spring Data Moore 已发布包括此功能(2019 年 10 月 8 日)。这是主要描述:

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:如果您需要更多详细信息,您可以查看此 jira 问题:

https://jira.spring.io/browse/DATAES-407 for more detail https://jira.spring.io/browse/DATAES-407了解更多详情

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Spring-data-elasticsearch vs elasticsearch RestHighLevelClient 客户端库 - Spring-data-elasticsearch vs elasticsearch RestHighLevelClient client library 带有AWS ElasticSearch的Java RestHighLevelClient - Java RestHighLevelClient with AWS ElasticSearch ElasticSearch 6.4:使用 RestHighLevelClient 进行映射 - ElasticSearch 6.4: Mapping with RestHighLevelClient Elasticsearch RestHighLevelClient 缺少传递依赖 - Elasticsearch RestHighLevelClient missing transitive dependencies 使用 Elasticsearch RestHighLevelClient 的聚合日期 - Aggregation date using Elasticsearch RestHighLevelClient Scala,Elasticsearch新的RestHighLevelClient和BulkProcessor - Scala, Elasticsearch the new RestHighLevelClient and BulkProcessor 使用RestHighLevelClient的ElasticSearch批量插入gies错误 - ElasticSearch Bulk insertion gies error using RestHighLevelClient 如何在 Elasticsearch 中使用 RestHighLevelClient 获取不同的值? - How to get Distinct values using RestHighLevelClient in Elasticsearch? Elasticsearch使用RestHighLevelClient设置限制和偏移量 - Elasticsearch set limit and offset using RestHighLevelClient 更改运行时超时 - Elasticsearch RestHighLevelClient - Change timeout in run time - Elasticsearch RestHighLevelClient
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM