Update By Query leads to "lang cannot be specified for stored scripts"

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.

Hi @jughead,

Thank you for your report. I opened an issue for it:

Cheers,
LG

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.