Cannot execute update by script

I am having a problem with this simple update:

http://localhost:9200/post_elastic/AV_e3-gqARzXw_Stq0-5/_update

{
    "script" : {
        "inline": "ctx._source.likes += 1",
        "lang": "painless"
    }
}

This leads to:

{
    "error": {
        "root_cause": [
            {
                "type": "remote_transport_exception",
                "reason": "[172.19.0.3][172.19.0.3:9300][indices:data/write/update[s]]"
            }
        ],
        "type": "illegal_argument_exception",
        "reason": "failed to execute script",
        "caused_by": {
            "type": "script_exception",
            "reason": "compile error",
            "script_stack": [],
            "script": "ctx._source.likes += 1",
            "lang": "painless",
            "caused_by": {
                "type": "runtime_exception",
                "reason": "java.lang.ClassNotFoundException: org.elasticsearch.painless.PainlessError"
            }
        }
    },
    "status": 400
}

The field to be incremented is an integer.
"likes": {
"type": "integer"
},

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