Hello,
I am trying to make an update script that would update a value in a document from one index with the value from a different document in another index. Is this possible, or do I have to do two separate POST statements?
The indices have a mapping similar to this.
{
"mappings" : {
"properties" : {
"name" : {
"type" : "text"
},
"last_modified" : {
"type" : "date"
}
}
}
}
I want an update statement like this:
POST /index2/_update/1
{
"script" : {
"source" : "ctx._source.last_modified = ctx[params.index].ctx[params.documentID]._source.last_modified",
"params" : {
"index" : "index1",
"documentID" : "2"
}
}
}
Any help would be greatly appreciated! Thanks in advance!