Put template APIs should only wrap a top level _doc json object field to the mapping if it is missing #71761
Labels
>bug
:Data Management/Indices APIs
APIs to create and manage indices and templates
Team:Data Management
Meta label for data/management team
Component and composable templates should accept mappings with and without a top level
_doc
json object.If the top level
_doc
json field is missing then it should be added to the mapping and if it already exists thenthe mapping doesn't need to be modified.
Currently in 8.0-snapshot (master) the put component and composable index templates add a toplevel
_doc
jsonobject to the mapping if it missing. However in 7.x and before this is not the case and if a mapping with
_doc
jsonobject as top level field is added then an error is returned that the root mapping as unsupported parameters. This
is because a mapping in a template is always wrapped in toplevel
_doc
json object field.Composable index template case:
The above request fails with a mapper exception (
Root mapping definition has unsupported parameters: [_doc : {properties={@timestamp={type=date}}}]"
).The above request succeeds.
Component template case:
The above request also fails with a mapper exception (
Root mapping definition has unsupported parameters: [_doc : {properties={@timestamp={type=date}}}]"
).The above request succeeds.
The text was updated successfully, but these errors were encountered: