diff options
Diffstat (limited to 'docs/reference/mapping/dynamic/default-mapping.asciidoc')
-rw-r--r-- | docs/reference/mapping/dynamic/default-mapping.asciidoc | 87 |
1 files changed, 6 insertions, 81 deletions
diff --git a/docs/reference/mapping/dynamic/default-mapping.asciidoc b/docs/reference/mapping/dynamic/default-mapping.asciidoc index 1483672744..4dbd723f9c 100644 --- a/docs/reference/mapping/dynamic/default-mapping.asciidoc +++ b/docs/reference/mapping/dynamic/default-mapping.asciidoc @@ -1,89 +1,14 @@ [[default-mapping]] === `_default_` mapping -The default mapping, which will be used as the base mapping for any new -mapping types, can be customised by adding a mapping type with the name +deprecated[6.0.0,See <<removal-of-types>>] + +The default mapping, which will be used as the base mapping for a new +mapping type, can be customised by adding a mapping type with the name `_default_` to an index, either when <<indices-create-index,creating the index>> or later on with the <<indices-put-mapping,PUT mapping>> API. +The documentation for this feature has been removed as it no longer makes +sense in 6.x where there can be only a single type per index. -[source,js] --------------------------------------------------- -PUT my_index -{ - "settings": { - "mapping.single_type": false - }, - "mappings": { - "_default_": { <1> - "_source": { - "enabled": false - } - }, - "user": {}, <2> - "blogpost": { <3> - "_source": { - "enabled": true - } - } - } -} --------------------------------------------------- -// CONSOLE -<1> The `_default_` mapping defaults the <<mapping-source-field,`_source`>> field to disabled. -<2> The `user` type inherits the settings from `_default_`. -<3> The `blogpost` type overrides the defaults and enables the <<mapping-source-field,`_source`>> field. - -NOTE: When updating the `_default_` mapping with the -<<indices-put-mapping,PUT mapping>> API, the new mapping is not merged with -the existing mapping. Instead, the new `_default_` mapping replaces the -existing one. - -While the `_default_` mapping can be updated after an index has been created, -the new defaults will only affect mapping types that are created afterwards. - -The `_default_` mapping can be used in conjunction with -<<indices-templates,Index templates>> to control dynamically created types -within automatically created indices: - - -[source,js] --------------------------------------------------- -PUT _template/logging -{ - "index_patterns": ["logs-*"], <1> - "settings": { "number_of_shards": 1 }, <2> - "mappings": { - "_default_": { - "_field_names": { <3> - "enabled": false - }, - "dynamic_templates": [ - { - "strings": { <4> - "match_mapping_type": "string", - "mapping": { - "type": "text", - "fields": { - "raw": { - "type": "keyword", - "ignore_above": 256 - } - } - } - } - } - ] - } - } -} - -PUT logs-2015.10.01/event/1 -{ "message": "error:16" } --------------------------------------------------- -// CONSOLE -<1> The `logging` template will match any indices beginning with `logs-`. -<2> Matching indices will be created with a single primary shard. -<3> The `_field_names` field will be disabled by default for new type mappings. -<4> String fields will be created with a `text` main field, and a `keyword` `.raw` field. |