簡體   English   中英

Hibernate搜索elasticsearch模式管理NONE仍然連接到elasticsearch?

[英]Hibernate search elasticsearch schema management NONE still connects to elasticsearch?

我正在考慮將我們的hibernate搜索實現從基於文件的lucene索引轉移到elasticsearch,但我對文檔感到困惑。 具體來說,對於索引模式管理策略NONE:

不會創建,刪除或更改索引,其映射和分析器定義。 Hibernate Search甚至不會檢查索引是否已存在。

我們想要刪除hibernate搜索的啟動依賴(因此它不會嘗試在啟動時查詢elasticsearch)。 閱讀模式管理策略表明NONE應該這樣做。

但是,看一下代碼的實現,我可以看到它仍然顯式檢查索引是否存在:

if (this.schemaManagementStrategy == IndexSchemaManagementStrategy.NONE) {
    this.schemaCreator.checkIndexExists(this.actualIndexName, this.schemaManagementExecutionOptions);
    return false;
}

我希望這不會發生。 當我進入一個故意不正確的主機連接時,服務器啟動仍然失敗:

 Request:
========
Operation: IndicesExists
URI: registryreference
Data:
null
Response:
=========
null
    at org.hibernate.search.elasticsearch.client.impl.JestClient.executeRequest(JestClient.java:188) ~[hibernate-search-elasticsearch-5.6.5.Final.jar:5.6.5.Final]
... (omitted rest of stack) 
Caused by: java.net.ConnectException: Connection refused: connect

我們正在使用hibernate search 5.6.5和elasticsearch 2.4.6。

這是一個錯誤: HSEARCH-2568

它已在Hibernate Search 5.7.0.Final中修復,因此升級應該可以解決問題。 但是,您必須將Hibernate ORM升級到5.2版本。 如果沿着這條路走下去,我建議直接升級到Hibernate Search 5.11和ORM 5.4,這是最新版本,其中修復了一些錯誤。

請注意,正如@Sanne所提到的,即使Hibernate Search不向Elasticsearch集群發送查詢,它仍可能會創建一個TCP連接池。 也許您可以告訴我們更多關於您的用例的信息,以便我們提供幫助?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM