Remove/Unmap a field alias

Hi,

I am using Elasticsearch 6.5 to create alias datatypes to fields (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

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.

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.

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