# Does removing field actually deletes data?

**URL:** <https://discuss.elastic.co/t/does-removing-field-actually-deletes-data/193511>\
**Category:** Elasticsearch\
**Created:** [August 2, 2019, 10:54am UTC](https://discuss.elastic.co/t/does-removing-field-actually-deletes-data/193511 "2019-08-02T10:54:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![74db36a597f21b891b3f](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/74db36a597f21b891b3f/32/45367_2.png) [@74db36a597f21b891b3f](https://discuss.elastic.co/u/74db36a597f21b891b3f)\
**Post date:** [August 2, 2019, 10:54am UTC](https://discuss.elastic.co/t/does-removing-field-actually-deletes-data/193511/1 "2019-08-02T10:54:12Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![luiz.santos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luiz.santos/32/24664_2.png) [@luiz.santos](https://discuss.elastic.co/u/luiz.santos)\
**Post date:** [August 9, 2019, 12:39pm UTC](https://discuss.elastic.co/t/does-removing-field-actually-deletes-data/193511/2 "2019-08-09T12:39:18Z")

</div>

Hi @74db36a597f21b891b3f,

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`](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html) API with the `only_expunge_deletes` parameter:

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 6, 2019, 12:39pm UTC](https://discuss.elastic.co/t/does-removing-field-actually-deletes-data/193511/3 "2019-09-06T12:39:20Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
