Deprecated: Optional parameter $keys declared before required parameter $cms_id is implicitly treated as a required parameter in /home/www/dev/work/class/blog/CmsKey.php on line 75

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\main::$outlink is deprecated in /home/www/dev/work/website/lvesu/template/blog/cms/cms.tpl on line 2

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\main::$status is deprecated in /home/www/dev/work/website/lvesu/template/blog/index.head.php on line 2
ElasticSearch更新后延迟解决方法 - 互联网笔记

略微加速

略速 - 互联网笔记

ElasticSearch更新后延迟解决方法

2021-01-04 leiting (4353阅读)

标签 Elasticsearch

在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


北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3