Problem with expression scripts through inline updates


(larry) #1

Hey Guys,

I'm trying to use expression scripts through inline updates vs using groovy through a file and ran into some issues. I'm testing with curl. Here is the code:

POST /aggregateusersearchterm_v2/aggregate_user_search_term/bread/_update 
{ 
    "script": { 
    "lang": "expression", 
    "inline" : "ctx._source['popularity']+=1" 
  } 
}

Accordingly to the documentation, I addedscript.engine.expression.inline.update: on to elasticsearch.yml but that didn't seems to work. Below is the error message.

{"error":{"root_cause":[{"type":"remote_transport_exception","reason":"[es-machine-01][x.x.x.x:9300][indices:data/write/update[s]]"}],"type":"illegal_argument_exception","reason":"failed to execute script","caused_by":{"type":"script_exception","reason":"scripts of type [inline], operation [update] and lang [expression] are not supported"}},"status":400}

I'm also doing similar test with groovy with similar config and there are no issues. script.engine.groovy.file.update: true.

I did some digging on the World Wide Web :slight_smile: but I didn't find much information for expression and seems like no one experienced similar issue with expression. I did found a lot information for groovy thou.

Any help will be greatly appreciated.


(Alexander Reelsen) #2

Hey,

the message in the error states

scripts of type [inline], operation [update] and lang [expression] are not supported

You cannot use expression scripts for updates or mapping scripts. Either use groovy or painless.

--Alex


(system) #3

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