# Problem with expression scripts through inline updates

**URL:** <https://discuss.elastic.co/t/problem-with-expression-scripts-through-inline-updates/67908>\
**Category:** Elasticsearch\
**Created:** [December 2, 2016, 10:41pm UTC](https://discuss.elastic.co/t/problem-with-expression-scripts-through-inline-updates/67908 "2016-12-02T22:41:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![larry521](https://avatars.discourse-cdn.com/v4/letter/l/a6a055/32.png) [@larry521](https://discuss.elastic.co/u/larry521)\
**Post date:** [December 2, 2016, 10:41pm UTC](https://discuss.elastic.co/t/problem-with-expression-scripts-through-inline-updates/67908/1 "2016-12-02T22:41:27Z")

</div>

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:

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

```

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

```auto
{"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 🙂 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.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 5, 2016, 9:02am UTC](https://discuss.elastic.co/t/problem-with-expression-scripts-through-inline-updates/67908/2 "2016-12-05T09:02:04Z")

</div>

Hey,

the message in the error states

```auto
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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 2, 2017, 9:02am UTC](https://discuss.elastic.co/t/problem-with-expression-scripts-through-inline-updates/67908/3 "2017-01-02T09:02:07Z")

</div>

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