Closed RicardoGralhoz closed 3 years ago
it looks related to #64999 and #64982
Pinging @elastic/es-search (Team:Search)
I can confirm that 7.1.0 allows using "ignore_malformed" in templates for keyword
type. However it already rejects the same parameter when directly used in a keyword
type mapping. With 7.10 we issue a deprecation warning when putting the template, but we should avoid throwing this error for existing malformed templates when adding documents with new fields.
I believe the problem is more general than just the "ignore_malformed" parameter on keyword
fields. With 7.10 we can put any unknown parameter in a "dynamic_templates" section for a type. We currently emit a deprecation warning, e.g.
PUT /my_index
{
"mappings": {
"dynamic_templates": [
{
"template_stdField": {
"mapping": {
"bla": true,
"type": "text"
},
"path_match": "*"
}
}
]
}
}
Will warn with
#! Deprecation: dynamic template [template_stdField] has invalid content [{"path_match":"*","mapping":{"bla":true,"type":"text"}}], caused by [unknown parameter [bla] on mapper [__dynamic__template_stdField] of type [text]]
However this opens the door for any indexed doc that matches the definition to throw an error since we try to parse the mapping just then and its illegal except for the few parameter names specifically defined in `ParametrizedFieldMapper#DEPRECATED_PARAMS" (like "boost", "meta" etc...).
Elasticsearch version: 7.10.1 (also seen on 7.8.1) This used to work on 7.1.0. It may be a breaking change in 7.4+ that apparently was not documented.
Plugins installed: none
JVM version : OpenJDK 64-Bit Server VM (build 11.0.3+7-Ubuntu-1ubuntu218.04.1)
OS version : Ubuntu 18.04.2 LTS
Description of the problem including expected versus actual behavior: Please see this forum topic
Using
ignore_malformed
on adynamic_template
mapping ofkeyword
type fires amapper_parsing_exception
when trying to index a document with a new field that matches the template. Indexing a document with an existing field that was matched before upgrading from 7.1.0 works fine, even if it's akeyword
field.There are differences in the docs when comparing versions 7.3 and 7.4. From 7.4 on it says:
– which excludes other types such as keyword.
Steps to reproduce:
Provide logs: