【问题标题】:Spring boot with Hibernate search - Index not created on elasticsearch带有 Hibernate 搜索的 Spring Boot - 未在 elasticsearch 上创建索引
【发布时间】:2019-06-14 14:50:39
【问题描述】:

索引是在本地文件目录上创建的,而不是在elasticsearch服务器上。

我创建了一个新的 Spring Boot 项目,用于数据库化使用的 spring-data 以及休眠搜索 - https://github.com/dhananjay12/spring-data/tree/master/es-hibernate-search-seperate

这是一个简单的 CRUD 操作。我使用 mysql 作为后端和 elasticsearch-5.6.3。 elasticsearch 在默认配置上运行

数据正在保存在 mysql 中,但未在 elasticsearch 服务器上创建索引。它是在我正在运行项目的文件中创建的

【问题讨论】:

  • 嗨!你解决了这个问题吗?我的经历完全一样。

标签: elasticsearch spring-data hibernate-search


【解决方案1】:

您可能忘记将 Elasticsearch 集成设置为所有索引的默认值。默认情况下,Hibernate Search 使用嵌入式 Lucene 集成。

只需在hibernate.properties 或persistence.xml 中将hibernate.search.default.indexmanager 属性设置为elasticsearch。

有关 Elasticsearch 特定配置的详细信息,请参阅 this section of the documentation。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-27
    • 2017-12-17
    • 2014-10-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多