Hello. I want to free some space on HDD so I decided to remove unneeded field from my indices.
I made a reindex with field deletion on some index. Then I compared sizes of old index and new index without some fields. And sizes are almost identical.
So, does field removal actually remove data that was contained in these fields?
When updating a document using the index API a new version of the document is always created even if the document hasn’t changed. The old document is marked as deleted logically. Behind the scenes, Elasticsearch will periodically merge segments of the indices and delete the flagged documents.
After the reindex operation you can force a cleanup using the _forcemerge API with the only_expunge_deletes parameter:
POST INDEX_NAME/_forcemerge?only_expunge_deletes=true&flush=true
IMPORTANT: The force merge API should be used only on special occasions and preferably on read-only indices.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.