【问题标题】:Hibernate Search 6.0.2.Final with opendistroHibernate Search 6.0.2.Final 与 opendistro
【发布时间】:2021-04-03 20:48:23
【问题描述】:

我有一个与Hibernate Search 6.0.2.Final 集成的Spring Boot 2.4.2 应用程序

当使用标准 elasticsearch 时,在持久化新实体上一切正常(读/写)。索引也会根据默认的simple 索引策略按预期创建myindex-000001

但是,当我将后端切换到 opendistro(最新)时,我只看到由名称 myindex-write 创建的单个索引(与预期的 myindex-000001 不同)。 写入操作按预期正常工作(由于后缀-write),但是读取操作失败并出现错误:

root_cause": [
      {
        "type": "index_not_found_exception",
        "reason": "no such index [myindex-read]",
        "resource.type": "index_or_alias",
        "resource.id": "myindex-read",
        "index_uuid": "_na_",
        "index": "myindex-read"
      }
    ]

opendistro 上的GET /_cat/aliases 表明索引没有别名。

解决此问题的最佳方法是什么? no-alias 策略显示here?使用no-alias 的缺点是缺乏像重新索引这样的蓝绿部署。 custom 索引策略是解决这个问题的最佳方法吗?

【问题讨论】:

    标签: hibernate-search hibernate-search-6


    【解决方案1】:

    以上所有问题都是因为我将hibernate.search.schema_management.strategy设置为none造成的。需要手动创建索引,如文档here中所述

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-07
      • 1970-01-01
      • 1970-01-01
      • 2018-06-08
      • 2015-04-19
      • 2018-12-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多