# Disable dynamic mapping

**URL:** <https://discuss.elastic.co/t/disable-dynamic-mapping/3182>\
**Category:** Elasticsearch\
**Created:** [August 2, 2010, 11:17pm UTC](https://discuss.elastic.co/t/disable-dynamic-mapping/3182 "2010-08-02T23:17:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ppearcy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppearcy/32/980_2.png) [@ppearcy](https://discuss.elastic.co/u/ppearcy)\
**Post date:** [August 2, 2010, 11:17pm UTC](https://discuss.elastic.co/t/disable-dynamic-mapping/3182/1 "2010-08-02T23:17:45Z")

</div>

Hello,  
I would like to disable dynamic mappings in the 0.9 release. I  
attempted do do this globally in the elasticsearch.yml by adding this:  
index:  
mapper:  
dynamic: false

I also tried to disable dynamic mappings at index creation with this  
data (in the form of a python dict):  
{'index':{'number\_of\_shards':5,'number\_of\_replicas':0,'mapper':  
{'dynamic':False}}}

Regardless of what I do, when I check the mapping status, I see:  
dynamic: true

Also, when I submit a doc with unknown fields, they end up getting  
indexed.

Is there anything that I am missing? Has anyone else been able to  
disable dynamic mapping?

Many Thanks!  
Paul

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 2, 2010, 11:24pm UTC](https://discuss.elastic.co/t/disable-dynamic-mapping/3182/2 "2010-08-02T23:24:35Z")

</div>

When you set the index.mapper.dynamic to false it means that new types will  
not be allowed to be introduced without declaring them first. If you want to  
disable dynamic option on the root object level mapping, then you will need  
to set dynamic to false on the root level object mapping that you define (or  
set it on the default mapping).

-shay.banon

On Tue, Aug 3, 2010 at 2:17 AM, Paul [ppearcy@gmail.com](mailto:ppearcy@gmail.com) wrote:

> Hello,  
> I would like to disable dynamic mappings in the 0.9 release. I  
> attempted do do this globally in the elasticsearch.yml by adding this:  
> index:  
> mapper:  
> dynamic: false
> 
> I also tried to disable dynamic mappings at index creation with this  
> data (in the form of a python dict):  
> {'index':{'number\_of\_shards':5,'number\_of\_replicas':0,'mapper':  
> {'dynamic':False}}}
> 
> Regardless of what I do, when I check the mapping status, I see:  
> dynamic: true
> 
> Also, when I submit a doc with unknown fields, they end up getting  
> indexed.
> 
> Is there anything that I am missing? Has anyone else been able to  
> disable dynamic mapping?
> 
> Many Thanks!  
> Paul

---

<div class="post-metadata">

**Author:** ![ppearcy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppearcy/32/980_2.png) [@ppearcy](https://discuss.elastic.co/u/ppearcy)\
**Post date:** [August 3, 2010, 12:03am UTC](https://discuss.elastic.co/t/disable-dynamic-mapping/3182/3 "2010-08-03T00:03:28Z")

</div>

Awesome, thanks!!!

I added 'dynamic':False to my put mappings and that did the trick.

On Aug 2, 5:24 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> When you set the index.mapper.dynamic to false it means that new types will  
> not be allowed to be introduced without declaring them first. If you want to  
> disable dynamic option on the root object level mapping, then you will need  
> to set dynamic to false on the root level object mapping that you define (or  
> set it on the default mapping).
> 
> -shay.banon
> 
> On Tue, Aug 3, 2010 at 2:17 AM, Paul [ppea...@gmail.com](mailto:ppea...@gmail.com) wrote:
> 
> > Hello,  
> > I would like to disable dynamic mappings in the 0.9 release. I  
> > attempted do do this globally in the elasticsearch.yml by adding this:  
> > index:  
> > mapper:  
> > dynamic: false
> 
> > I also tried to disable dynamic mappings at index creation with this  
> > data (in the form of a python dict):  
> > {'index':{'number\_of\_shards':5,'number\_of\_replicas':0,'mapper':  
> > {'dynamic':False}}}
> 
> > Regardless of what I do, when I check the mapping status, I see:  
> > dynamic: true
> 
> > Also, when I submit a doc with unknown fields, they end up getting  
> > indexed.
> 
> > Is there anything that I am missing? Has anyone else been able to  
> > disable dynamic mapping?
> 
> > Many Thanks!  
> > Paul

---

<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, 4:21am UTC](https://discuss.elastic.co/t/disable-dynamic-mapping/3182/4 "2017-07-06T04:21:12Z")

</div>


