# Remove/Unmap a field alias

**URL:** <https://discuss.elastic.co/t/remove-unmap-a-field-alias/159258>\
**Category:** Elasticsearch\
**Created:** [December 3, 2018, 11:29pm UTC](https://discuss.elastic.co/t/remove-unmap-a-field-alias/159258 "2018-12-03T23:29:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![GBP](https://avatars.discourse-cdn.com/v4/letter/g/e68b1a/32.png) [@GBP](https://discuss.elastic.co/u/GBP)\
**Post date:** [December 3, 2018, 11:29pm UTC](https://discuss.elastic.co/t/remove-unmap-a-field-alias/159258/1 "2018-12-03T23:29:50Z")

</div>

Hi,

I am using Elasticsearch 6.5 to create alias datatypes to fields ([https://www.elastic.co/guide/en/elasticsearch/reference/current/alias.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/alias.html)).

For e.g. I have this mapping

```
{
  "mappings": {
    "_doc": {
      "properties": {
        "distance": {
          "type": "long"
        },
        "route_length_miles": {
          "type": "alias",
          "path": "distance" 
        }
      }
    }
  }
}

```

Is there a way I can remove/unmap 'route\_length\_miles' from pointing to 'distance'? When field aliases are created, there doesn't seem to be a way to remove them unless the index itself is deleted (which is not a viable solution)

Thanks

---

<div class="post-metadata">

**Author:** ![mjunaidmuzammil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mjunaidmuzammil/32/56910_2.png) [@mjunaidmuzammil](https://discuss.elastic.co/u/mjunaidmuzammil)\
**Post date:** [December 4, 2018, 6:02am UTC](https://discuss.elastic.co/t/remove-unmap-a-field-alias/159258/2 "2018-12-04T06:02:30Z")

</div>

Unfortunately you'll have to reindex the documents. There isn't any way to delete an existing mapping, you can create a new mapping though using _`PUT _mapping`_ call.

---

<div class="post-metadata">

**Author:** ![GBP](https://avatars.discourse-cdn.com/v4/letter/g/e68b1a/32.png) [@GBP](https://discuss.elastic.co/u/GBP)\
**Post date:** [December 4, 2018, 11:13am UTC](https://discuss.elastic.co/t/remove-unmap-a-field-alias/159258/3 "2018-12-04T11:13:59Z")

</div>

Its pity that it can't be done for **aliases** though, as the aliases are just pointers to actual fields and can be re-pointed to different fields easily but cannot be unmapped once created.

---

<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:** [January 1, 2019, 11:14am UTC](https://discuss.elastic.co/t/remove-unmap-a-field-alias/159258/4 "2019-01-01T11:14:02Z")

</div>

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