bulk_writer: added clause to varname==ud update to also remove the tokens variable from source

master
Erik de Vries 6 years ago
parent 581e7b2929
commit 85aab558e0

@ -27,7 +27,7 @@ bulk_writer <- function(x, index = 'maml', varname = 'updated_variable', type) {
if (varname == "ud") {
return(
paste0('{"update": {"_index": "',index,'", "_type": "doc", "_id": "',x[1],'"}}
{ "script" : { "source": "ctx._source.ud = params.code", "lang" : "painless", "params": { "code": ',json,'}}}')
{ "script" : { "source": "ctx._source.ud = params.code; ctx._source.remove(\\"tokens\\")", "lang" : "painless", "params": { "code": ',json,'}}}')
)
}
if (type == 'set') {

Loading…
Cancel
Save