想要在reindex时,如果testNull字段为空,就赋一个默认值。
"script": {
"source": "if (ctx._source.testNull == null ) {ctx._source.testNull = "test2"}",
"lang": "painless"
}
老是报(这个符号解析有问题。
"script": {
"source": "if (ctx._source.testNull == null ) {ctx._source.testNull = "test2"}",
"lang": "painless"
}
老是报(这个符号解析有问题。
3 个回复
ygm
赞同来自: wssmao
{
"source": {
"index": "my_index_v9"
},
"dest": {
"index": "my_index_v9_tmp"
},
"script": {
"lang": "painless",
"inline": "if(ctx._source.enterpriseCategoryId==null){ctx._source.enterpriseCategoryId=224444}"
}
}
亲测,没毛病。
elasticStack - 90后it大数据男
赞同来自:
God_lockin
赞同来自: