amazon-web-services - 从 Elasticsearch 中删除元素时清除滚动

标签 amazon-web-services elasticsearch

每当我们从 Elasticsearch 集群中删除一些项目时,我们是否应该每次都清除滚动条?如果我们不这样做,会有什么影响?

我在一些示例代码中看到,对于删除,在删除项目之前,它首先搜索元素,然后清除滚动条。

最佳答案

来自 Elasticsearch documentation :

The results that are returned from a scroll request reflect the state of the index at the time that the initial search request was made, like a snapshot in time. Subsequent changes to documents (index, update or delete) will only affect later search requests.

因此,您不需要删除滚动上下文。事实上,您永远不需要删除上下文,因为它最终会自行删除。但是,最佳做法是在完成释放资源后删除滚动上下文。

您描述的情况的一个用例是查看程序是否仍在使用过时的文档。根据代码的不同,您可能不希望它使用已删除的文档,而是希望检索新的滚动上下文。

关于amazon-web-services - 从 Elasticsearch 中删除元素时清除滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57729647/

相关文章:

java - 从 lambda 函数发布到 AWS iot 上的主题 [Java]

amazon-web-services - 在 amazon ec2 linux 2 上安装 php-imap

logging - 如何将日志发送到 Graylog (Docker)?

elasticsearch - 从ElasticSearch读取数据时日期格式问题

json - 多个聚合Elasticsearch中START_OBJECT的未知 key

amazon-web-services - AWS Cloudformation 错误 : recursive lock because of recursive Import

amazon-web-services - 如果从同一实例转发,则 Amazon Web Services 负载均衡器转发到监听器不起作用

python - 为什么我在使用 boto 上传文件时得到 400?

elasticsearch - 带有 docker-compose 的 ELK 的推荐 RAM 比率

elasticsearch - logstash输出未显示在kibana中