es中创建后的mapping不可修改,但是可以添加新字段
添加新字段:
PUT /my_index/_mapping/my_type
{
"properties": {
"new_field_name": {
"type": "string"
}
}
}
赋值:
POST my_index/_update_by_query
{
"script": {
"lang": "painless",
"inline": "ctx._source.new_field_name= '02'"
}
}