# Questions about Enforcing ElasticSearch Mapping

**URL:** <https://discuss.elastic.co/t/questions-about-enforcing-elasticsearch-mapping/28551>\
**Category:** Elasticsearch\
**Created:** [September 2, 2015, 7:03pm UTC](https://discuss.elastic.co/t/questions-about-enforcing-elasticsearch-mapping/28551 "2015-09-02T19:03:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dadepo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadepo/32/19944_2.png) [@dadepo](https://discuss.elastic.co/u/dadepo)\
**Post date:** [September 2, 2015, 7:03pm UTC](https://discuss.elastic.co/t/questions-about-enforcing-elasticsearch-mapping/28551/1 "2015-09-02T19:03:11Z")

</div>

Ok, so I created a mapping...say we call it "my\_mapping" that specifies two properties: "property1, property2"...

So I then attempted to index a document with the following format:

> {  
> "newproperty5" : "Value"  
> }

With the expectation that the indexing operation will fail with Elasticsearch telling me the structure of the document is wrong...but to my utmost surprise the document was still indexed! And when I checked the mapping definition for "my\_mapping" I found out that Elasticsearch has silently updated my mapping definition to now include the property "newproperty5"!

Can someone explain how this makes sense? What is the essence of creating a type when it can't be strictly enforced!

---

<div class="post-metadata">

**Author:** ![jelmer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jelmer/32/3550_2.png) [@jelmer](https://discuss.elastic.co/u/jelmer)\
**Post date:** [September 2, 2015, 7:10pm UTC](https://discuss.elastic.co/t/questions-about-enforcing-elasticsearch-mapping/28551/2 "2015-09-02T19:10:59Z")

</div>

I believe you can disable dynamic mapping. see :

[https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-object-type.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-object-type.html)

---

<div class="post-metadata">

**Author:** ![dadepo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadepo/32/19944_2.png) [@dadepo](https://discuss.elastic.co/u/dadepo)\
**Post date:** [September 2, 2015, 8:22pm UTC](https://discuss.elastic.co/t/questions-about-enforcing-elasticsearch-mapping/28551/3 "2015-09-02T20:22:34Z")

</div>

@jelmer and I also found this [https://www.elastic.co/guide/en/elasticsearch/guide/current/dynamic-mapping.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/dynamic-mapping.html)

Thanks!

---

<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:52pm UTC](https://discuss.elastic.co/t/questions-about-enforcing-elasticsearch-mapping/28551/4 "2017-07-05T23:52:30Z")

</div>


