# Unable to disable dynamic mapping

**URL:** <https://discuss.elastic.co/t/unable-to-disable-dynamic-mapping/41999>\
**Category:** Elasticsearch\
**Created:** [February 17, 2016, 10:18am UTC](https://discuss.elastic.co/t/unable-to-disable-dynamic-mapping/41999 "2016-02-17T10:18:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronsher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ronsher/32/1334_2.png) [@ronsher](https://discuss.elastic.co/u/ronsher)\
**Post date:** [February 17, 2016, 10:18am UTC](https://discuss.elastic.co/t/unable-to-disable-dynamic-mapping/41999/1 "2016-02-17T10:18:27Z")

</div>

I'm using version 1.7.4

We've set index.mapper.dynamic: false in the elasticsearch.yml

I've noticed that new fields are automatically created (and added to the mapping) even though they are not part of the original mapping we provided.

I was under the impression that dynamic:false ignores fields that are not defined (as opposed to strict that also throws an exception).

Am I missing something?

---

<div class="post-metadata">

**Author:** ![charmon79](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@charmon79](https://discuss.elastic.co/u/charmon79)\
**Post date:** [February 17, 2016, 6:24pm UTC](https://discuss.elastic.co/t/unable-to-disable-dynamic-mapping/41999/2 "2016-02-17T18:24:56Z")

</div>

Try adding "dynamic":"false" to your mapping:

```
{
	"MyDocument":{
		"dynamic":"false",
		"properties":{
			...
		}
	}
}
```

---

<div class="post-metadata">

**Author:** ![ronsher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ronsher/32/1334_2.png) [@ronsher](https://discuss.elastic.co/u/ronsher)\
**Post date:** [February 18, 2016, 5:54am UTC](https://discuss.elastic.co/t/unable-to-disable-dynamic-mapping/41999/3 "2016-02-18T05:54:10Z")

</div>

Isn't putting index.mapper.dynamic: false in the elasticsearch.yml file a valid configuration?  
Does elasticsearch ignore that?

---

<div class="post-metadata">

**Author:** ![anhlqn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anhlqn/32/5454_2.png) [@anhlqn](https://discuss.elastic.co/u/anhlqn)\
**Post date:** [February 18, 2016, 7:35am UTC](https://discuss.elastic.co/t/unable-to-disable-dynamic-mapping/41999/4 "2016-02-18T07:35:11Z")

</div>

I think your index mapping may overwrite the settings in elasticsearch.yml.

---

<div class="post-metadata">

**Author:** ![ronsher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ronsher/32/1334_2.png) [@ronsher](https://discuss.elastic.co/u/ronsher)\
**Post date:** [February 18, 2016, 7:42am UTC](https://discuss.elastic.co/t/unable-to-disable-dynamic-mapping/41999/5 "2016-02-18T07:42:30Z")

</div>

But I wanted the default to block dynamic mappings

---

<div class="post-metadata">

**Author:** ![anhlqn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anhlqn/32/5454_2.png) [@anhlqn](https://discuss.elastic.co/u/anhlqn)\
**Post date:** [February 18, 2016, 7:56am UTC](https://discuss.elastic.co/t/unable-to-disable-dynamic-mapping/41999/6 "2016-02-18T07:56:27Z")

</div>

Can you post your current mapping templates?

---

<div class="post-metadata">

**Author:** ![charmon79](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@charmon79](https://discuss.elastic.co/u/charmon79)\
**Post date:** [February 19, 2016, 1:47pm UTC](https://discuss.elastic.co/t/unable-to-disable-dynamic-mapping/41999/7 "2016-02-19T13:47:21Z")

</div>

Sounds like this was a known bug & possibly fixed in December, though I'm not sure how to tell in which version (I'm still rather new to git).

> <https://github.com/elastic/elasticsearch/issues/15381>

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [February 24, 2016, 11:07pm UTC](https://discuss.elastic.co/t/unable-to-disable-dynamic-mapping/41999/8 "2016-02-24T23:07:25Z")

</div>

> [@charmon79](#):
>
> Sounds like this was a known bug & possibly fixed in December, though I'm not sure how to tell in which version (I'm still rather new to git).

It will be fixed in version 2.3.0 of Elasticsearch.

---

<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:13pm UTC](https://discuss.elastic.co/t/unable-to-disable-dynamic-mapping/41999/9 "2017-07-05T23:13:49Z")

</div>


