- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想用RestHighLevelClient
在不同集群上使用 Cross Cluster mechanizem 不支持的命令(例如关闭和打开索引)。
我的问题是我是否使用了多个 RestHighLevelClient
的实例对于每个集群,它将为每个集群保持连接打开? (以确保我没有阻塞应用程序)
最佳答案
通过查看各种资源,好像RestHighLevelClient
除非您明确调用 client.close();
,否则保持连接打开在上面。
来自 official RestHighLevelClient initialization
The high-level client will internally create the low-level client usedto perform requests based on the provided builder. That low-levelclient maintains a pool of connections and starts some threads so youshould close the high-level client when you are well and truly donewith it and it will in turn close the internal low-level client tofree those resources. This can be done through the close method:
RestHighLevelClient
与您猜测的相比,它可能会由于线程及其资源的占用而阻塞您的应用程序,因此您应该显式调用
close
当您再次创建它时需要更多时间,但在大多数情况下不会阻塞您的应用程序。
close
客户端频繁,这不需要过度分配资源,但是当您为请求创建新客户端时,延迟会更多。 关于elasticsearch - RestHighLevelClient 是否保持连接打开?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64410714/
我正在尝试从需要访问外部请求代理的网络中访问Cloud Elasticsearch安装。这是我用来传递Elasticsearch凭证和我们的代理设置的代码片段: CredentialsProvider
如果elasticsearch在单一模式下运行,我可以使用以下代码轻松建立RestHighLevel连接: RestHighLevelClient client = new RestHighLevel
我想用RestHighLevelClient在不同集群上使用 Cross Cluster mechanizem 不支持的命令(例如关闭和打开索引)。 我的问题是我是否使用了多个 RestHighLev
我需要模拟 RestHighLevelClient 来测试我的代码。基本上,当我调用 RestHighLevelClient 的“搜索”方法时,我得到 UnfinishedStubbingExcept
我正在对包含空格的字段执行搜索,我希望不对其进行分析,即不将其拆分为克并被视为单个实体。我如何在 Java 中执行此操作? 我正在使用 RESTHighLevelClient 版本 7.4。 最佳答案
我正在尝试通过此依赖项使用 RestHighLevelClient org.elasticsearch.client elasticsearch-rest-h
我正在尝试在 Scala 程序中插入 ElasticSearch(ES)。 在 build.sbt 我添加了 libraryDependencies += "org.elasticsearch.cli
我正在使用vpc端点进行 flex 搜索,以使用RestHighLevelClient索引我的文档。 我正在使用Java高级休息客户端v6.2.2连接Elasticsearch 6.0版 我无需任何身
我想知道这里是否有人使用 RestHighLevelClient 连接到 AWS ElasticSearch。不确定 AWS ElasticSearch 是否支持此功能。目前,每次尝试连接时,我都会收
我正在使用 Elasticsearch RestHighLevelClient 并尝试实现下面的 sql: select format(date,'yyyy-MM-dd'), count(*) fro
我使用 MultiSearchRequest 按字段的一部分在 Elasticsearch 中进行搜索: @Override public Collection> findContractsByInd
我在 Elasticsearch 中为 RestHighLevelClient 使用以下代码。 val credentialsProvider = new BasicCredentialsProvid
当索引 100k 文档时,以下行出现 listener 超时异常 IndexResponse response = SearchEngineClient.getInstance2().index(re
我试过下面的代码它工作正常,但它使用 运输客户端 删除所有文档。 DeleteByQueryRequestBuilder deleteByQueryRequestBuilder = DeleteByQ
我们的应用程序在 elasticsearch 服务器中索引(存储)文档时遇到超时异常。它不会经常发生,但大约每天一次。这是详细信息。 pom.xml org.elasticsearch.cl
Elastic 正在更新他们的文档以使用带有 Java 的 RestHighLevelClient。它还具有映射 API: https://www.elastic.co/guide/en/elasti
我在 SpringBoot 应用程序中创建 HighEndRestClient bean 时遇到错误。我已经完成了一个测试“应用程序”,我检查了我可以实例化我想要的对象,然后进行我想要的调用,现在我正
如何在下面使用bool创建RestHighLevelClient查询? 我的尝试未返回任何内容: BoolQueryBuilder query = boolQuery()
在我的 Elasticsearch 索引中,我保存了大约 30000 个实体。我想使用 RestHighLevelClient 获取它们的所有 id。我读过最好的方法是使用滚动 api。但是,当我这样
在我的 Scala 项目中,我试图用新的 RestHighLevelClient 更改旧的 transportClient 以连接到 Elasticsearch (6.1)。 但我在尝试创建 Bulk
我是一名优秀的程序员,十分优秀!