Skip to content

Latest commit

 

History

History
32 lines (27 loc) · 1.15 KB

45_Default_Mapping.asciidoc

File metadata and controls

32 lines (27 loc) · 1.15 KB

Default Mapping

Often, all types in an index share similar fields and settings. It can be more convenient to specify these common settings in the default mapping, instead of having to repeat yourself every time you create a new type. The default mapping acts as a template for new types. All types created after the default mapping will include all of these default settings, unless explicitly overridden in the type mapping itself.

For instance, we can disable the all field for all types, using the _default mapping, but enable it just for the blog type, as follows:

PUT /my_index
{
    "mappings": {
        "_default_": {
            "_all": { "enabled":  false }
        },
        "blog": {
            "_all": { "enabled":  true  }
        }
    }
}

The default mapping can also be a good place to specify index-wide dynamic templates.