设置参数 `node.name` 可以自定义 Elasticsearch 节点的名字。 此条 Tips 由 medcl 贡献。

往已存在的index增加字段报错,求助

Elasticsearch | 作者 runningman7012 | 发布于2020年12月02日 | 阅读数:1509

往已存在的index增加字段报错
{ - 
"error": { -
"root_cause": [ -
{ -
"type": "illegal_argument_exception",
"reason": "Can't merge because of conflicts: [Cannot update excludes setting for [_source]]"
}
],
"type": "illegal_argument_exception",
"reason": "Can't merge because of conflicts: [Cannot update excludes setting for [_source]]"
},
"status": 400
}
我的语句:
PUT my-index/_mapping
{
"properties": {
"content2": {
"analyzer": "ik_max_word",
"type": "text"
}
}
}
我的index
{ - 
"my-index": { -
"aliases": { -

},
"mappings": { -
"_all": { -
"enabled": false
},
"_source": { -
"excludes": [ -
"content"
]
},
"dynamic_templates": [ -
{ -
"str": { -
"match_mapping_type": "string",
"mapping": { -
"index": false,
"store": false,
"type": "keyword"
}
}
}
],
"properties": { -
"@timestamp": { -
"type": "date"
},
"content": { -
"type": "text",
"analyzer": "ik_max_word"
}
"sid": { -
"type": "keyword"
}
}
},
"settings": { -
"index": { -
"number_of_shards": "6",
"provided_name": "my-index",
"mapper": { -
"dynamic": "true"
},
"creation_date": "1572581052119",
"store": { -
"type": "niofs"
},
"number_of_replicas": "1",
"uuid": "aHHcjI_NQlyOUVcnkm1ZUg",
"version": { -
"created": "6040399",
"upgraded": "7070199"
}
}
}
}
}
已邀请:

God_lockin

赞同来自:

貌似没法重现,你可以看一下你有没有其他template能命中,报错中说是你字段定义有冲突,可能是这个原因

JiangJibo - 喊我雷锋

赞同来自:

和你的 "_source": { - "excludes": [ - "content" ] } 有关系,
es的源码:

3F6BDC74-3B0B-484e-B9B6-EA715964F6A4.png

 

要回复问题请先登录注册