弹簧数据弹性搜索可以连接到连接到弹性搜索的代理REST服务吗?

发布于 2025-01-31 22:36:10 字数 507 浏览 3 评论 0 原文

我的公司在其余端点 /搜索和 /计数后面有弹性搜索,但它隐藏了访问的群集节点。

我可以通过本机DSL查询来调用这些休息端点,但是我不想创建许多用于创建查询和映射响应的样板代码,这就是为什么我想使用Spring Data Data弹性搜索来做很多事情对我来说。我想知道是否可以通过代理静止端点连接到弹簧数据弹性搜索到ES实例,但基于 docs ,似乎Spring Data ES只能连接到ES实例。还有其他人有这种需求吗?

Spring Data Elasticsearch在连接到单个Elasticsearch节点或群集的Elasticsearch客户端上操作。

My company has Elastic Search behind the REST endpoints /search and /count, but it hides the cluster nodes from access.

I could call those REST endpoints through Native DSL queries, but I don't want to create a lot of the boilerplate code that comes with creating queries and mapping responses, which is why I would like to use Spring Data Elastic Search to do a lot of that for me. I would like to know if it is possible to connect to Spring Data Elastic Search to an ES instance through a proxy REST endpoint, but based on the docs, it seems like Spring Data ES can only connect to the ES Instance. Has anyone else had this kind of need?

Spring Data Elasticsearch operates upon an Elasticsearch client that is connected to a single Elasticsearch node or a cluster.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

勿忘初心 2025-02-07 22:36:10

您链接到。在本章中,在您找到了描述如何配置代理:

ClientConfiguration clientConfiguration = ClientConfiguration.builder()
  .connectedTo("localhost:9200", "localhost:9291")                      
  .withProxy("localhost:8888")                                          
  .build();

You link to the documentation, Chapter Elasticsearch Clients. In this chapter, in the section Client Configuration you find the description how to configure a proxy:

ClientConfiguration clientConfiguration = ClientConfiguration.builder()
  .connectedTo("localhost:9200", "localhost:9291")                      
  .withProxy("localhost:8888")                                          
  .build();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文