背景

为了业务须要,es存储数据须要增加字段:

es版本是7.13.x

内容

进行字段迁徙时候,须要依照要求批改对应的模板:template、索引mapping。

模板批改

查问对应模板:
GET /_template/template_name
批改模板
PUT /_template/template_name{  // 这里是从之前检索到的索引的具体信息}

在对应模块下增加:

,"sourceWeight" : {  "store" : true,  "type" : "integer"},"imgPaths" : {  "store" : true,  "type" : "keyword"},"filePaths" : {  "store" : true,  "type" : "keyword"},"extra" : {  "store" : true,  "type" : "keyword"}

mapping批改

查问索引mapping
 GET /test_tr_01/_mapping
批改索引mapping
PUT /test_tr*/_mapping{ //具体mapping信息}