我尝试将 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
。可能的值为 green
或 red
。
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/