# StrictDynamicMapping and MultiFields

**URL:** <https://discuss.elastic.co/t/strictdynamicmapping-and-multifields/19616>\
**Category:** Elasticsearch\
**Created:** [September 4, 2014, 8:11am UTC](https://discuss.elastic.co/t/strictdynamicmapping-and-multifields/19616 "2014-09-04T08:11:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_O\_Gara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john_o_gara/32/1297_2.png) [@John\_O\_Gara](https://discuss.elastic.co/u/John_O_Gara)\
**Post date:** [September 4, 2014, 8:11am UTC](https://discuss.elastic.co/t/strictdynamicmapping-and-multifields/19616/1 "2014-09-04T08:11:17Z")

</div>

I'm having a problem with using strict dynamic mapping and multi-field  
values. My multi fields work fine when I don't have StrictDynamicMapping  
enabled but when I enable it I get the error

"error": "StrictDynamicMappingException[mapping set to strict, dynamic  
introduction of [email.downcased] within [External::User] is not allowed]"

The significant part of my index request looks something like this

PUT /test\_app\_9/External::User/12  
{  
"email": "john@john.com",  
"email.downcased": "john@john.com",  
"name": "John Doe",  
"name.downcased": "john doe",  
"browser\_locale": "en",  
.... all other attributes  
}

and the significant part of my mapping is as below. What am I doing wrong?

```
  "mappings": {
     "External::User": {
        "dynamic": "strict",
        "dynamic_templates": [
           {
              "string_custom_data": {
                 "mapping": {
                    "type": "multi_field",
                    "fields": {
                       "{name}": {
                          "index": "no",
                          "type": "string"
                       },
                       "downcased": {
                          "index": "not_analyzed",
                          "type": "string"
                       }
                    }
                 },
                 "match": "*_string"
              }
           },
           {
              "date_custom_data": {
                 "mapping": {
                    "type": "date"
                 },
                 "match": "*_date"
              }
           }
        ],
        "_all": {
           "enabled": false
        },
        "properties": {
           "app_id": {
              "type": "integer"
           },
           "browser_locale": {
              "type": "string",
              "index": "no",
              "fields": {
                 "downcased": {
                    "type": "string",
                    "index": "not_analyzed"
                 }
              }
           },
           "email": {
              "type": "string",
              "index": "no",
              "fields": {
                 "downcased": {
                    "type": "string",
                    "index": "not_analyzed"
                 }
              }
           },

```

.....  
}

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/826c34f9-cc1c-4cea-abea-fdaf7a2d40cd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/826c34f9-cc1c-4cea-abea-fdaf7a2d40cd%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![John\_O\_Gara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john_o_gara/32/1297_2.png) [@John\_O\_Gara](https://discuss.elastic.co/u/John_O_Gara)\
**Post date:** [September 4, 2014, 12:23pm UTC](https://discuss.elastic.co/t/strictdynamicmapping-and-multifields/19616/2 "2014-09-04T12:23:35Z")

</div>

Is any extra information required?

On Thursday, September 4, 2014 9:11:17 AM UTC+1, John O'Gara wrote:

> I'm having a problem with using strict dynamic mapping and multi-field  
> values. My multi fields work fine when I don't have StrictDynamicMapping  
> enabled but when I enable it I get the error
> 
> "error": "StrictDynamicMappingException[mapping set to strict, dynamic  
> introduction of [email.downcased] within [External::User] is not allowed]"
> 
> The significant part of my index request looks something like this
> 
> PUT /test\_app\_9/External::User/12  
> {  
> "email": "[john@john.com](mailto:john@john.com)",  
> "email.downcased": "[john@john.com](mailto:john@john.com)",  
> "name": "John Doe",  
> "name.downcased": "john doe",  
> "browser\_locale": "en",  
> .... all other attributes  
> }
> 
> and the significant part of my mapping is as below. What am I doing wrong?
> 
> ```
> "mappings": {
> "External::User": {
> "dynamic": "strict",
> "dynamic_templates": [
> {
> "string_custom_data": {
> "mapping": {
> "type": "multi_field",
> "fields": {
> "{name}": {
> "index": "no",
> "type": "string"
> },
> "downcased": {
> "index": "not_analyzed",
> "type": "string"
> }
> }
> },
> "match": "*_string"
> }
> },
> {
> "date_custom_data": {
> "mapping": {
> "type": "date"
> },
> "match": "*_date"
> }
> }
> ],
> "_all": {
> "enabled": false
> },
> "properties": {
> "app_id": {
> "type": "integer"
> },
> "browser_locale": {
> "type": "string",
> "index": "no",
> "fields": {
> "downcased": {
> "type": "string",
> "index": "not_analyzed"
> }
> }
> },
> "email": {
> "type": "string",
> "index": "no",
> "fields": {
> "downcased": {
> "type": "string",
> "index": "not_analyzed"
> }
> }
> },
> 
> ```
> 
> .....  
> }

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/2d3f7613-d555-4b61-b50d-ef12a53540b6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2d3f7613-d555-4b61-b50d-ef12a53540b6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![MarkOStewart](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@MarkOStewart](https://discuss.elastic.co/u/MarkOStewart)\
**Post date:** [March 15, 2016, 9:04pm UTC](https://discuss.elastic.co/t/strictdynamicmapping-and-multifields/19616/3 "2016-03-15T21:04:30Z")

</div>

Not one reply?  
I'm having similar issues and would like to know if you or anyone else has any hints on how to update a field with "dynamic": "strict" set on the index mappings.

I need to change a mis-spelled last name. For instance change Steward to Stewart w/o changing any other data or mappings.

---

<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:08pm UTC](https://discuss.elastic.co/t/strictdynamicmapping-and-multifields/19616/4 "2017-07-05T23:08:10Z")

</div>


