# How to remove a field from elastic search mapping?

**URL:** https://discuss.elastic.co/t/how-to-remove-a-field-from-elastic-search-mapping/271691
**Category:** Elasticsearch
**Created:** [April 29, 2021, 5:41pm UTC](https://discuss.elastic.co/t/how-to-remove-a-field-from-elastic-search-mapping/271691 "2021-04-29T17:41:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![vk98](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vk98/32/87967_2.png) [@vk98](https://discuss.elastic.co/u/vk98)
#### Post date: [April 29, 2021, 5:41pm UTC](https://discuss.elastic.co/t/how-to-remove-a-field-from-elastic-search-mapping/271691/1 "2021-04-29T17:41:23Z")

</div>

I have added a field which is not actually required in elastic search. Now I want to get rid of it. Changing mapping or making a new one will reindex my whole data. Which is very huge and cant afford to do such thing. Can anyone suggest something by which i can get rid of this newly added field without reindexing?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 29, 2021, 6:02pm UTC](https://discuss.elastic.co/t/how-to-remove-a-field-from-elastic-search-mapping/271691/2 "2021-04-29T18:02:19Z")

</div>

Welcome.

You can't.

---

<div class="post-metadata">

### Author: ![vk98](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vk98/32/87967_2.png) [@vk98](https://discuss.elastic.co/u/vk98)
#### Post date: [April 30, 2021, 7:01am UTC](https://discuss.elastic.co/t/how-to-remove-a-field-from-elastic-search-mapping/271691/3 "2021-04-30T07:01:03Z")

</div>

Thanks, But I didn't get why it is not feasible. Or what is the idea behind not letting users do this? Can you please explain a bit on this.

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 30, 2021, 7:24am UTC](https://discuss.elastic.co/t/how-to-remove-a-field-from-elastic-search-mapping/271691/4 "2021-04-30T07:24:51Z")

</div>

Because Lucene produces immutable segments. Changing the mapping is not doable because the data continues to live in the segments somewhere.  
Just don't use that field in your application and that's all.

If you want to remove it entirely, you will need to remove it from all segments which can only be done by rewriting all the segments, which is reindexing actually.

---

<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: [May 28, 2021, 7:24am UTC](https://discuss.elastic.co/t/how-to-remove-a-field-from-elastic-search-mapping/271691/5 "2021-05-28T07:24:54Z")

</div>

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