| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 | [[mapping-dynamic-mapping]]== Dynamic MappingDefault mappings allow to automatically apply generic mapping definitionto types that do not have mapping pre defined. This is mainly donethanks to the fact that the<<mapping-object-type,object mapping>> andnamely the <<mapping-root-object-type,rootobject mapping>> allow for schema-less dynamic addition of unmappedfields.The default mapping definition is plain mapping definition that isembedded within the distribution:[source,js]--------------------------------------------------{    "_default_" : {    }}--------------------------------------------------Pretty short, no? Basically, everything is defaulted, especially thedynamic nature of the root object mapping. The default mappingdefinition can be overridden in several manners. The simplest manner isto simply define a file called `default-mapping.json` and placed itunder the `config` directory (which can be configured to exist in adifferent location). It can also be explicitly set using the`index.mapper.default_mapping_location` setting.The dynamic creation of mappings for unmapped types can be completelydisabled by setting `index.mapper.dynamic` to `false`.The dynamic creation of fields within a type can be completelydisabled by setting the `dynamic` property of the type to `strict`.Here is a <<indices-put-mapping,Put Mapping>> example thatdisables dynamic field creation for a `tweet`:[source,js]--------------------------------------------------$ curl -XPUT 'http://localhost:9200/twitter/tweet/_mapping' -d '{    "tweet" : {        "dynamic": "strict",        "properties" : {            "message" : {"type" : "string", "store" : true }        }    }}'--------------------------------------------------Here is how we can change the default<<mapping-date-format,date_formats>> used in theroot and inner object types:[source,js]--------------------------------------------------{    "_default_" : {        "date_formats" : ["yyyy-MM-dd", "dd-MM-yyyy", "date_optional_time"]    }}--------------------------------------------------
 |