I am using the below code to update a document in elasticsearch
client.update({
index: 'myindex',
type: 'mytype',
id: '1',
body: {
script: 'ctx._source.tags += tag',
params: { tag: 'some new tag' }
}
}, function (error, response) {
});
However, this throws a compile error. When I replace tag by params.tag
above, it appends null to the present field i.e. identifies params.tag
as null
.