Version: Elasticsearch 6.0.0
POST _scripts/blablabla
{
"script": {
"source": "ctx._source.field2 = params.t.field2",
"lang": "painless"
}
}
PUT test/foo/1
{
"user_id": 10,
"field1": "value1",
"field2": 12
}
POST test/foo/_update_by_query
{
"query": {
"bool": {
"must": [{
"term": { "user_id": 10 }
}]
}
},
"script": {
"id": "blablabla",
"params": {
"t": {
"filed2": 13
}
}
}
}
leads to
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "lang cannot be specified for stored scripts"
}
],
"type": "illegal_argument_exception",
"reason": "lang cannot be specified for stored scripts"
},
"status": 400
}
Playing around lang value by removing/moving/setting to blank doesn't help.