# Deleting part of mapping in Elasticsearch 1.7

**URL:** https://discuss.elastic.co/t/deleting-part-of-mapping-in-elasticsearch-1-7/45286
**Category:** Elasticsearch
**Created:** [March 23, 2016, 10:52pm UTC](https://discuss.elastic.co/t/deleting-part-of-mapping-in-elasticsearch-1-7/45286 "2016-03-23T22:52:29Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)
#### Post date: [March 23, 2016, 10:52pm UTC](https://discuss.elastic.co/t/deleting-part-of-mapping-in-elasticsearch-1-7/45286/1 "2016-03-23T22:52:29Z")

</div>

Hi All,

By mistake I added a wrong mapping as below

```
"person_info" : {
        "_timestamp" : {
          "enabled" : true,
          "store" : true
        },
        "properties" : {
          "entry_time" : {
            "type" : "date",
            "format" : "dateOptionalTime"
          },
          "address" : {
            "properties" : {
              "local_address" : {
                "properties" : {
                   "street" : {
                    "type" : "string"
                  },
                  "city" : {
                    "type" : "string"
                  },
                  "zip" : {
                    "type" : "string"
                  }
              }
              "local_address" : {
                "properties" : {
                  "street" : {
                    "type" : "string"
                  },
                  "city" : {
                    "type" : "string"
                  },
                  "zip" : {
                    "type" : "long"
                  }
                }
              }
            }
          }       
        }
      }
    }

```

where zip is string in one mapping and long in another. Is there any way to remove any one of the mapping?

Regards,

---

<div class="post-metadata">

### Author: ![wyhw](https://avatars.discourse-cdn.com/v4/letter/w/c5a1d2/32.png) [@wyhw](https://discuss.elastic.co/u/wyhw)
#### Post date: [March 24, 2016, 6:46am UTC](https://discuss.elastic.co/t/deleting-part-of-mapping-in-elasticsearch-1-7/45286/2 "2016-03-24T06:46:55Z")

</div>

Once mapping have created , can not be modified manually

---

<div class="post-metadata">

### Author: ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)
#### Post date: [March 24, 2016, 7:09am UTC](https://discuss.elastic.co/t/deleting-part-of-mapping-in-elasticsearch-1-7/45286/3 "2016-03-24T07:09:12Z")

</div>

Thank you.

---

<div class="post-metadata">

### Author: ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)
#### Post date: [March 24, 2016, 6:35pm UTC](https://discuss.elastic.co/t/deleting-part-of-mapping-in-elasticsearch-1-7/45286/4 "2016-03-24T18:35:32Z")

</div>

I don't mind losing one of the mapping data. What is the best way to to migrate to 2.2 from 1.7? For sure I will get mapping exception if I move to 2.2

---

<div class="post-metadata">

### Author: ![ywelsch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ywelsch/32/7751_2.png) [@ywelsch](https://discuss.elastic.co/u/ywelsch)
#### Post date: [March 24, 2016, 6:40pm UTC](https://discuss.elastic.co/t/deleting-part-of-mapping-in-elasticsearch-1-7/45286/5 "2016-03-24T18:40:55Z")

</div>

You can use the Elasticsearch Migration Plugin to check whether you can safely upgrade.

> **[elastic/elasticsearch-migration](https://github.com/elastic/elasticsearch-migration)**
>
> elasticsearch-migration - This plugin will help you to check whether you can upgrade directly to the next major version of Elasticsearch, or whether you need to make changes to your data and cluste...

---

<div class="post-metadata">

### Author: ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)
#### Post date: [March 24, 2016, 6:52pm UTC](https://discuss.elastic.co/t/deleting-part-of-mapping-in-elasticsearch-1-7/45286/6 "2016-03-24T18:52:57Z")

</div>

It says I cannot upgrade.

```
Conflicting field mappings
Mapping for field myindex_type1:person_info.address.zip conflicts with: myindex_type2:person_info.address.zip. Check parameter: type
```

---

<div class="post-metadata">

### Author: ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)
#### Post date: [March 24, 2016, 6:54pm UTC](https://discuss.elastic.co/t/deleting-part-of-mapping-in-elasticsearch-1-7/45286/7 "2016-03-24T18:54:31Z")

</div>

Is there any way to fix this through code? I can delete the index type but not whole index. How can I remove one of the mapping?

---

<div class="post-metadata">

### Author: ![ywelsch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ywelsch/32/7751_2.png) [@ywelsch](https://discuss.elastic.co/u/ywelsch)
#### Post date: [March 24, 2016, 6:55pm UTC](https://discuss.elastic.co/t/deleting-part-of-mapping-in-elasticsearch-1-7/45286/8 "2016-03-24T18:55:39Z")

</div>

There is no other way than reindexing. This means creating a new index with proper mapping and reindexing all the documents, deleting your old index afterwards.

---

<div class="post-metadata">

### Author: ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)
#### Post date: [March 24, 2016, 6:57pm UTC](https://discuss.elastic.co/t/deleting-part-of-mapping-in-elasticsearch-1-7/45286/9 "2016-03-24T18:57:38Z")

</div>

That's gonna be pain since this is already deployed in multiple environment. I wish there was a way to convert all the improper data type to string globally if we don't care about aggregation.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [March 24, 2016, 8:45pm UTC](https://discuss.elastic.co/t/deleting-part-of-mapping-in-elasticsearch-1-7/45286/10 "2016-03-24T20:45:55Z")

</div>

There is, reindex 😛

---

<div class="post-metadata">

### Author: ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)
#### Post date: [March 24, 2016, 9:42pm UTC](https://discuss.elastic.co/t/deleting-part-of-mapping-in-elasticsearch-1-7/45286/11 "2016-03-24T21:42:58Z")

</div>

Not when I have TB's of data and minimal down time 🙂

---

<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: [July 5, 2017, 11:05pm UTC](https://discuss.elastic.co/t/deleting-part-of-mapping-in-elasticsearch-1-7/45286/12 "2017-07-05T23:05:20Z")

</div>


