java - HibernateSearch 5.7.1.Final 版本提示 ElasticSearch 黄色索引状态

标签 java elasticsearch hibernate-search

我尝试将 HibernateSearch 从版本 5.7.0.Alpha1 升级到版本 5.7.1.Final,但这是不可能的。运行使用 Final 版本编译的应用程序时出现以下错误:

Exception in thread "main" org.hibernate.search.exception.SearchException:
HSEARCH400024: Timed out while waiting for for index
'com.example.app.model.journal' to reach status 'green';
status was still 'yellow' after 10000ms.

索引状态 yellow 在我的设置中是典型的(我认为)。我的整个集群状态是黄色,因为是单机部署ElasticSearch(测试用)。所以我想阻止 HibernateSearch 等待 green 状态并强制它接受 yellow 状态(以前的版本不这样做)。是否有一些我可以设置的设置,例如在 hibernate.cfg.xml 中?

我发现开发者论坛上讨论了这个问题,但没有人提到设置名称。

最佳答案

只需将此属性 hibernate.search.default.elasticsearch.required_index_status 设置为 yellow。可能的值为 greenred

Only operate if the index is at this level or safer. In development, set this value to yellow if the number of nodes started is below the number of expected replicas.

您可以在此 documentation 中找到更多信息

关于java - HibernateSearch 5.7.1.Final 版本提示 ElasticSearch 黄色索引状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45547831/

相关文章:

java - 使用 Hibernate Search 的空间查询始终返回空结果集

hibernate - Lucene:查找以特定前缀开头的所有单词

java - 在不提供哈希码的情况下从 Redis 中检索 Person 对象

java - 直接从intelliJ在系统终端上运行java程序?

elasticsearch - 如何为日志设置当前时间(-zone)?

elasticsearch - sql到es:在agg上获取限制页面和订单结果

java - 在 hibernate 搜索中关闭索引

java - 简单的数学表达式解析

java - 使用 CompletableFuture 故意破坏堆栈不会产生堆栈溢出?

elasticsearch - 如何格式化Filebeat中的日志