我是 Elasticsearch 的新手。我们正在使用 Elasticsearch 构建一个 Spring 启动应用程序。
为了集成我的 Spring boot 应用程序,我们可以使用 elasticsearch-rest-high-level-client
或 spring-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/