| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 | [[index-modules-mapper]]== MapperThe mapper module acts as a registry for the type mapping definitionsadded to an index either when creating it or by using the put mappingapi. It also handles the dynamic mapping support for types that have noexplicit mappings pre defined. For more information about mappingdefinitions, check out the <<mapping,mapping section>>.[float]=== Dynamic MappingsNew types and new fields within types can be added dynamically justby indexing a document.  When Elasticsearch encounters a new type,it creates the type using the `_default_` mapping (see below).When it encounters a new field within a type, it autodetects thedatatype that the field contains and adds it to the type mappingautomatically.See <<mapping-dynamic-mapping>> for details of how to control andconfigure dynamic mapping.[float]=== Default MappingWhen a new type is created (at <<indices-create-index,index creation>> time,using the  <<indices-put-mapping,`put-mapping` API>> or just by indexing adocument into it), the type uses the `_default_` mapping as its basis.  Anymapping specified in the  <<indices-create-index,`create-index`>> or<<indices-put-mapping,`put-mapping`>> request override values set in the`_default_` mapping.The default mapping definition is a plain mapping definition that isembedded within Elasticsearch:[source,js]--------------------------------------------------{    _default_ : {    }}--------------------------------------------------Pretty short, isn't it? Basically, everything is `_default_`ed, including thedynamic nature of the root object mapping which allows new fields to be addedautomatically.The default mapping can be overridden by specifying the `_default_` type whencreating a new index.Dynamic creation of mappings for unmapped types can be completelydisabled by setting `index.mapper.dynamic` to `false`.
 |