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>
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.