diff --git a/R/bulk_writer.R b/R/bulk_writer.R index 90c8a9f..63205f3 100644 --- a/R/bulk_writer.R +++ b/R/bulk_writer.R @@ -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') {