How to free up unused space after deleting documents in ElasticSearch?

1.3k Views Asked by At

When deleting records in ElasticSearch, I heard that the disk space is not freed up. So if I only wanted to keep rolling three months of documents in a type, how do I ensure that disk space is reused?

1

There are 1 best solutions below

0
On BEST ANSWER

The system will naturally re-use the space freed up as it needs to, provided the files have been marked as such by ElasticSearch.

However, ElasticSearch goes through a series of stages Even 'retiring' the data will not remove it from the system, only hide it away.

This command should do what you need: DELETE /

See here for more information: https://www.elastic.co/guide/en/elasticsearch/guide/current/retiring-data.html