I want to add something into array “tags”:[“red”] using JavaScript api in elastic search, currently, i am doing this as follows:
client.update(
"test":{
"index": "test",
"type": "type1",
"id": "1",
"body": {
"script": "ctx._source.tags += tag",
"params": { "tag": "blue" }
}
})
this changes the field "tags" : ["red"] to "tags" : blue instead of ["red","blue"],
I am getting the expected output via Ubuntu Terminal using curl -XPUT or curl -XPOST methods
My node module elastic search version is 2.4.2 elastic search server is 1.3.2
Please Help...