elasticsearch: how to free store size after deleting documents

前端 未结 4 733
旧时难觅i
旧时难觅i 2020-12-07 16:24

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

4条回答
  •  执念已碎
    2020-12-07 16:57

    knutwalker's answer is correct. However if you are using AWS ElasticSearch and want to free storage space, this will not quite work.

    On AWS the index to forgemerge must be specified in the URL. It can include wildcards as is common with index rotation.

    curl -XPOST 'https://something.es.amazonaws.com/index-*/_forcemerge?only_expunge_deletes=true'
    

    AWS publishes a list of ElasticSearch API differences.

提交回复
热议问题