Mapping defined in templates merges incorrectly ( multi-fields )

Elasticsearch version : 7.10.0
When I create an index that matched two templates(templates -> index patterns) (A field in a mapping defined in the two templates that have a multi-fields defined) and trying to insert a document I get the following error:

{
    "error": {
        "root_cause": [
            {
                "type": "mapper_parsing_exception",
                "reason": "unknown parameter [ignore_above] on mapper [myfield1] of type [text]"
            }
        ],
        "type": "mapper_parsing_exception",
        "reason": "Failed to parse mapping [_doc]: unknown parameter [ignore_above] on mapper [myfield1] of type [text]",
        "caused_by": {
            "type": "mapper_parsing_exception",
            "reason": "unknown parameter [ignore_above] on mapper [myfield1] of type [text]"
        }
    },
    "status": 400
}

It seems that when creating an index that matches the index patterns of both templates, the mapping that was created to the index (that merged from the two templates) is incorrect.

The behavior I would expect to happen is that the field will be overridden in a multi-field according to the higher-order.

1. PUT _template/mytemplate
{
  "order":1,
  "index_patterns": [
    "*logs*"
  ],
  "mappings": {
    "properties": {
      "myfield": {
        "type": "text",
        "fields": {
          "myfield1":{
            "type":"keyword",
            "ignore_above":256
          }
        }
      }
    }
  }
}
 2.PUT _template/mytemplate2
{
  "order":2,
  "index_patterns": [
    "es_logs*"
  ],
  "mappings": {
    "properties": {
      "myfield": {
        "type": "text",
        "fields": {
          "myfield1":{
            "type":"text"
          }
        }
      }
    }
  }
}
 3. POST es_logs-21/_doc
{
  "myfield1":"chipopo"
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.