怎么又是你

index.refresh_interval 不生效怎么回事?

Elasticsearch | 作者 240475588 | 发布于2017年08月15日 | 阅读数:5325

elasticsearch 5.4.3
index.refresh_interval:-1 不生效怎么回事?批量更新数据,elasticsearch-head查询数据是实时更新的,一条条可以查询出来可见
已邀请:

xufenxu

赞同来自:

如果没有强制的去执行refresh或者flush,新写入的数据应该是查不到的才对。

laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net

赞同来自:

用rest接口就可以动态生效,索引级别修改: PUT /_settings
{
"refresh_interval" : "60s"
}

zqc0512 - andy zhou

赞同来自:

5好像是用的模板吧,这玩意动态调整了,好像不支持elasticsearch.yml配置文件

hapjin

赞同来自:

index.refresh_interval设置成-1的意义是:不允许ES后台线程将 新写入到 in-memory buffer里面的 文档 自动 刷新生成 segments。


If the refresh interval is set to -1, disabling the automatic refreshes


但是,还会有其他情况触发refresh,导致 搜索可见(visible to search)
1,realtime GET API 会触发 refresh


 If a document has been updated but is not yet refreshed, the get API will issue a refresh call in-place to make the document visible. 


2,delete操作、搜索操作,都可以带上一个 ?refresh 选项,都会触发 in-memory indexing-buffer 刷新成 segments,从而导致搜索可见。


The indexing buffer is used to store newly indexed documents. When it fills up, the documents in the buffer are written to a segment on disk. 

要回复问题请先登录注册