1、安装搭建,请参考其他文章或者自行百度
2、dsl语句:
添加字段:
PUT index/_mapping
{
"properties":{
"remark":{"type":"keyword"}
}
}
修改旧数据:
POST index/_doc/_update_by_query
{
"script": {
"lang": "painless",
"inline": "if (ctx._source.remark== null) {ctx._source.remark= '备注'}"
},
"query":{
"bool":{
"must_not":{
"exists":{
"field":"remark"
}
}
}
}
}
head操作: