弹性搜索:删除文档后如何释放商店大小 [英] elasticsearch: how to free store size after deleting documents

查看:100
本文介绍了弹性搜索:删除文档后如何释放商店大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的弹性搜索服务器上:
总文件数:300万,总大小:3.6G
然后,我删除了大约2.8百万个文档:
总共文档:约0.13万,总大小: 3.6G



我已经删除了文件,应该如何释放文件的大小?

解决方案

删除文件只会将其标记为已删除,因此不会被搜索。要回收磁盘空间,您必须优化索引:

  curl -XPOST'http:// localhost:9200 / _optimize? only_expunge_deletes = true'

文档: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-optimize.html



更新



从Elasticsearch 2.1.x开始,优化 已被弃用赞成 forcemerge
API是相同的

  curl -XPOST'http:// localhost:9200 / _forcemerge?only_expunge_deletes = true'


On my elasticsearch server: total documents: 3 million, total size: 3.6G Then, I delete about 2.8 millions documents: total documents: about 0.13 million, total size: 3.6G

I have deleted the documents, how should I free the size of the documents?

解决方案

Deleting documents only flags these as deleted, so they would not be searched. To reclaim disk space, you have to optimize the index:

curl -XPOST 'http://localhost:9200/_optimize?only_expunge_deletes=true'

documentation: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-optimize.html

Update

Starting with Elasticsearch 2.1.x, optimize is deprecated in favor of forcemerge. The API is the same, only the endpoint did change.

curl -XPOST 'http://localhost:9200/_forcemerge?only_expunge_deletes=true'

这篇关于弹性搜索:删除文档后如何释放商店大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆