java - Spring Data Elastic Search 与 Java 高级 REST 客户端

标签 java spring-boot maven elasticsearch elasticsearch-high-level-restclient

我是 Elasticsearch 的新手。我们正在使用 Elasticsearch 构建一个 Spring 启动应用程序。

为了集成我的 Spring boot 应用程序,我们可以使用 elasticsearch-rest-high-level-clientspring-boot-starter-data-elasticsearch

谁能详细说明哪个选项总体上更好,为什么?

最佳答案

spring-boot-starter-data-elasticsearch 内部可以使用 transport(soon to be deprecated in ES 8.X)rest-high-level-client 请引用 elasticsearch client section 了解更多信息以及如何配置它们。

从同一个链接:

Spring data Elasticsearch operates upon an Elasticsearch client that is connected to a single Elasticsearch node or a cluster. Although the Elasticsearch Client can be used to work with the cluster, applications using Spring Data Elasticsearch normally use the higher level abstractions of Elasticsearch Operations and Elasticsearch Repositories.



最重要的是,您可以在 Spring Boot 应用程序中直接使用 rest-high-level 客户端,但是如果您想要更多抽象,那么您可以使用 spring-boot-starter-data-elasticsearch 依赖项并使用其提供更多抽象的方法,尽管在内部它将使用 Elasticsearch 提供的客户端。

关于java - Spring Data Elastic Search 与 Java 高级 REST 客户端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62382457/

相关文章:

java - 推荐java中的非GPL XMPP服务器

java - 哪个resteasy-client适合Jboss 6.4 EAP?

java - 模拟 System.nanoTime()

java - Spring Boot @ConditionalOnProperty 不加载 bean

java - 每条消息都需要 Cipher.init() 吗?

Spring Boot Web 服务客户端身份验证

java - 具有多个相同类型值对象的聚合根问题

java - 如何防止 Maven 的 spring-boot 插件将静态资源复制到目标?

maven - 如何将持久存储连接到 Google Cloud Build?

java - 启动tomcat7 :run maven plugin within eclipse and debug