# Disabling dynamic mapping

**URL:** <https://discuss.elastic.co/t/disabling-dynamic-mapping/20662>\
**Category:** Elasticsearch\
**Created:** [November 10, 2014, 3:45pm UTC](https://discuss.elastic.co/t/disabling-dynamic-mapping/20662 "2014-11-10T15:45:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pulkitsinghal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pulkitsinghal/32/802_2.png) [@pulkitsinghal](https://discuss.elastic.co/u/pulkitsinghal)\
**Post date:** [November 10, 2014, 3:45pm UTC](https://discuss.elastic.co/t/disabling-dynamic-mapping/20662/1 "2014-11-10T15:45:38Z")

</div>

What does the json in the CURL request for this look like?

The dynamic creation of mappings for unmapped types can be completely  
disabled by setting _index.mapper.dynamic_ to false.  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-dynamic-mapping.html#mapping-dynamic-mapping](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-dynamic-mapping.html#mapping-dynamic-mapping)

Thanks!

- Pulkit

--  
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/a9131f0a-3a3d-4617-96ac-d77c12d9d48c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a9131f0a-3a3d-4617-96ac-d77c12d9d48c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![brian\_yoder](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@brian\_yoder](https://discuss.elastic.co/u/brian_yoder)\
**Post date:** [November 10, 2014, 4:58pm UTC](https://discuss.elastic.co/t/disabling-dynamic-mapping/20662/2 "2014-11-10T16:58:14Z")

</div>

This is what I put into the elasticsearch.yml file when I start  
Elasticsearch for use in a non-ELK environment:

# Do not automatically create an index when a document is loaded, and do

# not automatically index unknown (unmapped) fields:

action.auto\_create\_index: false  
index.mapper.dynamic: false

And here's a complete example of a curl input document that I use to create  
an index with the desired types in which I don't want new indices, new  
types, or new fields to be automatically created:

{  
"settings" : {  
"index" : {  
"number\_of\_shards" : 1,  
"analysis" : {  
"char\_filter" : { },  
"filter" : {  
"english\_snowball\_filter" : {  
"type" : "snowball",  
"language" : "English"  
}  
},  
"analyzer" : {  
"english\_standard\_analyzer" : {  
"type" : "custom",  
"tokenizer" : "standard",  
"filter" : ["standard", "lowercase", "asciifolding"]  
},  
"english\_stemming\_analyzer" : {  
"type" : "custom",  
"tokenizer" : "standard",  
"filter" : [ "standard", "lowercase", "asciifolding",  
"english\_snowball\_filter" ]  
}  
}  
}  
}  
},  
"mappings" : {  
"_default_" : {  
"dynamic" : "strict"  
},  
"person" : {  
"\_all" : {  
"enabled" : false  
},  
"properties" : {  
"telno" : {  
"type" : "string",  
"analyzer" : "english\_standard\_analyzer"  
},  
"gn" : {  
"type" : "string",  
"analyzer" : "english\_standard\_analyzer"  
},  
"sn" : {  
"type" : "string",  
"analyzer" : "english\_stemming\_analyzer"  
},  
"o" : {  
"type" : "string",  
"analyzer" : "english\_stemming\_analyzer"  
}  
}  
}  
}  
}

By the way, I never mix indices that are used for more standard database  
queries with the indices used by the ELK stack. Those are two separate  
Elasticsearch clusters entirely; the former is locked down as shown above,  
while the latter is left in its default "free form" method of automatically  
creating indices and new fields on the fly, just as Splunk and ELK and  
other log analysis tools do.

I hope this helps.

Brian

On Monday, November 10, 2014 10:45:38 AM UTC-5, pulkitsinghal wrote:

> What does the json in the CURL request for this look like?
> 
> The dynamic creation of mappings for unmapped types can be completely  
> disabled by setting _index.mapper.dynamic_ to false.
> 
> [Elastic — The Search AI Company | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-dynamic-mapping.html#mapping-dynamic-mapping)
> 
> Thanks!
> 
> - Pulkit

--  
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/9b257ef5-3b87-43fe-a64b-1114da64d671%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9b257ef5-3b87-43fe-a64b-1114da64d671%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:51am UTC](https://discuss.elastic.co/t/disabling-dynamic-mapping/20662/3 "2017-07-06T00:51:03Z")

</div>


