ElasticSearch 更新後延遲解決方法

2021-10-05 04:10:33 字數 361 閱讀 9258

在index後有乙個refresh_interval預設1秒,在這個時間間隔內search是不可見的。

解決辦法有兩種:

1,通過ui層解決。比如更新成功後,彈出提示框;

2,設定重新整理策略,有以下三種(es版本5.4.3)。

public static enum refreshpolicy implements writeable {

none("false"), // 預設;非同步重新整理,立即返回;

immediate("true"), // 立即重新整理,對es集群壓力會比較大

wait_until("wait_for"); // 等重新整理時返回,響應性不太好,

elasticsearch基本操作 更新

介紹之前首先看一下es的字段型別 核心資料型別 text byte short integer long float double boolean date 復合資料型別 array object 注意 新版本es不支援string型別,支援text index ml 索引 相當於關聯式資料庫中的資...

Elasticsearch如何更新mapping

既然已建立的 indices 無法修改,我們可以重新建立乙個新的 indices,然後將原 indices 上的資料複製到新的 indices 上,再將 alias 指向新 indices。最後,刪除原索引。引數說明 當前索引名稱 test v1 生產索引名稱 test 目標索引名稱 test v2...

Elasticsearch區域性更新(陣列追加)

現在需要實現這樣乙個功能 本人使用es版本為5.4.0 比如 我這需要操作的某個欄位tags tag1 tag2 tag3 現在發現了乙個新標籤 tag4 需要加入到tags中。第1步 建立乙個新文件 確定 index test index type test type id 1 post test...