# Update mapping of not\_analyzed field

**URL:** <https://discuss.elastic.co/t/update-mapping-of-not-analyzed-field/59173>\
**Category:** Elasticsearch\
**Created:** [August 29, 2016, 11:20am UTC](https://discuss.elastic.co/t/update-mapping-of-not-analyzed-field/59173 "2016-08-29T11:20:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![butsjoh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/butsjoh/32/11658_2.png) [@butsjoh](https://discuss.elastic.co/u/butsjoh)\
**Post date:** [August 29, 2016, 11:20am UTC](https://discuss.elastic.co/t/update-mapping-of-not-analyzed-field/59173/1 "2016-08-29T11:20:32Z")

</div>

I would like to have some clarity on why it is not possible to update a not\_analyzed field to a multi field. The documentation is not exactly clear on that ([https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html#updating-field-mappings](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html#updating-field-mappings)). It states that "new multi-fields can be added to existing fields" but it does not seems to work for not\_analyzed fields. Curious on why not?

Examples below are not tested but should reveal the thing i am trying.

PUT my\_index  
{  
"mappings": {  
"test": {  
"properties": {  
"field1": {  
"type": "string"  
},  
"field2": {  
"type": "string",  
"index": "not\_analyzed"  
}  
}  
}  
}  
}

This works fine for field1:

PUT my\_index/\_mapping/test

{  
"mappings": {  
"test": {  
"properties": {  
"field1": {  
"type": "string",  
"fields": {  
"raw": {  
"type": "string",  
"index": "not\_analyzed"  
},  
"search": {  
"type": "string"  
}  
}  
}  
}  
}  
}  
}

This fails for field2:

PUT my\_index/\_mapping/test

{  
"mappings": {  
"test": {  
"properties": {  
"field2": {  
"type": "string",  
"fields": {  
"raw": {  
"type": "string",  
"index": "not\_analyzed"  
},  
"search": {  
"type": "string"  
}  
}  
}  
}  
}  
}  
}

ElasticSearchClient::ElasticSearchError: [400] {"error":{"root\_cause":[{"type":"illegal\_argument\_exception","reason":"Mapper for [field2] conflicts with existing mapping in other types:\n[mapper [field2] has different [index] values, mapper [field2] has different [omit\_norms] values, cannot change from disable to enabled, mapper [field2] has different [analyzer]]"}],"type":"illegal\_argument\_exception","reason":"Mapper for [field2] conflicts with existing mapping in other types:\n[mapper [field2] has different [index] values, mapper [field2] has different [omit\_norms] values, cannot change from disable to enabled, mapper [field2] has different [analyzer]]"},"status":400}

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [August 30, 2016, 9:17am UTC](https://discuss.elastic.co/t/update-mapping-of-not-analyzed-field/59173/2 "2016-08-30T09:17:37Z")

</div>

Hi @butsjoh,

the error message says:

> mapper [field2] has different [omit\_norms] values, cannot change from disable to enabled

You (implicitly) try to enable norms after the fact which is not possible, see the [user docs on norms](https://www.elastic.co/guide/en/elasticsearch/reference/current/norms.html) for more information.

You can also see all index settings with the [get field mapping API](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-field-mapping.html#indices-get-field-mapping):

```auto
GET /my_index/_mapping/test/field/field2?include_defaults=true

```

Basically, you need to keep the index options (which means, keeping `field2` and `not_analyzed`), then everything works fine:

```auto
PUT my_index/_mapping/test
{
   "properties": {
      "field2": {
         "type": "string",
         "index": "not_analyzed",
         "fields": {
            "raw": {
               "type": "string",
               "index": "not_analyzed"
            },
            "search": {
               "type": "string"
            }
         }
      }
   }
}

```

If you don't want to do that, you need to create a new index and reindex the data from the old index.

Daniel

---

<div class="post-metadata">

**Author:** ![butsjoh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/butsjoh/32/11658_2.png) [@butsjoh](https://discuss.elastic.co/u/butsjoh)\
**Post date:** [August 30, 2016, 10:04am UTC](https://discuss.elastic.co/t/update-mapping-of-not-analyzed-field/59173/3 "2016-08-30T10:04:15Z")

</div>

Ok but it still means i can create multifields for field2 that are analyzed not?

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [August 30, 2016, 10:08am UTC](https://discuss.elastic.co/t/update-mapping-of-not-analyzed-field/59173/4 "2016-08-30T10:08:53Z")

</div>

Hi @butsjoh,

yes, the subfields of `field2` can have different index options.

Daniel

---

<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, 10:24pm UTC](https://discuss.elastic.co/t/update-mapping-of-not-analyzed-field/59173/5 "2017-07-05T22:24:07Z")

</div>


