# Changing the dynamic mapping setting on an existing mapping

**URL:** <https://discuss.elastic.co/t/changing-the-dynamic-mapping-setting-on-an-existing-mapping/9991>\
**Category:** Elasticsearch\
**Created:** [December 7, 2012, 4:51pm UTC](https://discuss.elastic.co/t/changing-the-dynamic-mapping-setting-on-an-existing-mapping/9991 "2012-12-07T16:51:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tudor\_Leu](https://avatars.discourse-cdn.com/v4/letter/t/d26b3c/32.png) [@Tudor\_Leu](https://discuss.elastic.co/u/Tudor_Leu)\
**Post date:** [December 7, 2012, 4:51pm UTC](https://discuss.elastic.co/t/changing-the-dynamic-mapping-setting-on-an-existing-mapping/9991/1 "2012-12-07T16:51:57Z")

</div>

How can I turn off dynamic mapping for an existing mapping? Is it possible  
to do it on the fly, or I need to do it when I create the mapping?

Here's a set of commands I tried to test this:

> <https://gist.github.com/tudorleu/4234508>

It looks like setting the dynamic setting to "strict" after the mapping  
creation does not work, and new documents added with fields not specified  
in the original mapping will change the mapping definition.

-Tudor

--

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [December 14, 2012, 4:04pm UTC](https://discuss.elastic.co/t/changing-the-dynamic-mapping-setting-on-an-existing-mapping/9991/2 "2012-12-14T16:04:38Z")

</div>

Hi Tudor,

The `dynamic` property can't be modified on an existing mapping. If  
the `dynamic` property is specified on the top level then the only  
option I see now is to create a new mapping. You can specify `dynamic`  
also on any object type inside your mapping. If that is the case then  
you can add a new field of type object with a different `dynamic`  
setting. In any case you still need to update your documents.

Martijn

On 7 December 2012 17:51, Tudor Leu [tudor@foursquare.com](mailto:tudor@foursquare.com) wrote:

> How can I turn off dynamic mapping for an existing mapping? Is it possible  
> to do it on the fly, or I need to do it when I create the mapping?
> 
> Here's a set of commands I tried to test this:  
> [Elasticsearch - changing dynamic mapping to strict · GitHub](https://gist.github.com/4234508)
> 
> It looks like setting the dynamic setting to "strict" after the mapping  
> creation does not work, and new documents added with fields not specified in  
> the original mapping will change the mapping definition.
> 
> -Tudor
> 
> --

--  
Met vriendelijke groet,

Martijn van Groningen

--

---

<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 6, 2017, 2:59am UTC](https://discuss.elastic.co/t/changing-the-dynamic-mapping-setting-on-an-existing-mapping/9991/3 "2017-07-06T02:59:50Z")

</div>


