elasticsearch 在模板合成期间无法替换映射字段,elasticsearch,mapping,elasticsearch,Mapping" /> elasticsearch 在模板合成期间无法替换映射字段,elasticsearch,mapping,elasticsearch,Mapping" />

elasticsearch 在模板合成期间无法替换映射字段

elasticsearch 在模板合成期间无法替换映射字段,elasticsearch,mapping,elasticsearch,Mapping,我正在尝试在Elasticsearch 7.8.0中设置由一些组件模板组成的模板索引。 其中一个组件模板在现有对象上创建新字段映射,这会引发以下错误“在模板合成期间无法替换映射字段[tcp]” 以下是复制的步骤: PUT _component_template/tcp_service {"template": { "mappings": { "properties": {

我正在尝试在Elasticsearch 7.8.0中设置由一些组件模板组成的模板索引。 其中一个组件模板在现有对象上创建新字段映射,这会引发以下错误“在模板合成期间无法替换映射字段[tcp]”

以下是复制的步骤:

PUT _component_template/tcp_service
    {"template": {
            "mappings": {
                "properties": {
                    "tcp": {
                        "properties": {
                            "tcpService": {
                                "type": "keyword"
                            },
                            "udpService": {
                                "type": "keyword"
                            }
                        }
                    }
                }
            }
        }
    }
哪个回应

{
"acknowledged" : true
}
然后创建索引模板

PUT _index_template/data
{
   "index_patterns": ["data_*"],
   "composed_of": ["tcp_service"],
   "template": {
          "aliases": {
                 "data": {}
          },
   "settings": {
       "index": {
           "number_of_shards": "2",
           "number_of_replicas": "1"
       }
   },
   "mappings": {
       "properties": {
          "tcp": {
               "properties": {
                   "dstPort": {
                       "type": "keyword"
                   }
               }
            }
         }
      }
   }
}
答案是什么

{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "composable template [data] template after composition with component templates [tcp_service] is invalid"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "composable template [data] template after composition with component templates [tcp_service] is invalid",
    "caused_by" : {
      "type" : "illegal_argument_exception",
      "reason" : "invalid composite mappings for [data]",
      "caused_by" : {
        "type" : "illegal_argument_exception",
        "reason" : "mapping fields [tcp] cannot be replaced during template composition"
      }
    }
  },
  "status" : 400
}
我是否提高了弹性搜索限制

实现这一点的唯一方法是在索引模板中包含组件模板字段吗

模板索引对象不能用组件模板更新吗