在index后有一个refresh_interval默认1秒,在这个时间间隔内search是不可见的。
解决办法有两种:
1,通过ui层解决。操作成功后只操作UI,而不是通过ES。
2,加上?refresh=wait_for,表示如果1秒内有请求立即更新并可见。
参考:
https://stackoverflow.com/questions/31499575/how-to-deal-with-elasticsearch-index-delay
https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-refresh.html#docs-refresh
解决Elasticsearch索引延迟

本文探讨了Elasticsearch中索引后的刷新间隔导致的数据搜索延迟问题,并提供了两种解决方案:一是通过用户界面层直接更新显示,避免实时索引刷新;二是通过添加参数?refresh=wait_for来立即刷新索引,使新索引在一秒钟内即可被搜索到。
1006





