Document that the PUT mapping API with the _default_ type overwrites instead of merging

Closes #8215
This commit is contained in:
Clinton Gormley 2016-11-26 12:43:56 +01:00
parent 5ae6845d4d
commit 5555e85619
2 changed files with 11 additions and 1 deletions

View File

@ -1,7 +1,7 @@
[[indices-put-mapping]] [[indices-put-mapping]]
== Put Mapping == Put Mapping
The PUT mapping API allows you to provide type mappings while creating a new index, add a new type to an existing index, or add new The PUT mapping API allows you to add a new type to an existing index, or add new
fields to an existing type: fields to an existing type:
[source,js] [source,js]
@ -62,6 +62,11 @@ PUT /{index}/_mapping/{type}
* `{body}` contains the mapping changes that should be applied. * `{body}` contains the mapping changes that should be applied.
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.
[[updating-field-mappings]] [[updating-field-mappings]]
[float] [float]
=== Updating field mappings === Updating field mappings

View File

@ -32,6 +32,11 @@ PUT my_index
<2> The `user` type inherits the settings from `_default_`. <2> The `user` type inherits the settings from `_default_`.
<3> The `blogpost` type overrides the defaults and enables the <<mapping-all-field,`_all`>> field. <3> The `blogpost` type overrides the defaults and enables the <<mapping-all-field,`_all`>> 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, 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 new defaults will only affect mapping types that are created afterwards.