User script Error

This is My first Error because I learn ES my English is not goods so please help me:
i want user script
and i send a post
POST /test_index/test_type/4/_update
{
"script": {
"lang": "groovy",
"file": "test-add-tags",
"params": {
"new_tag": "tag1"
}
}
}

but the result is error :
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "[script] unknown field [file], parser not found"
}
],
"type": "illegal_argument_exception",
"reason": "[script] unknown field [file], parser not found"
},
"status": 400
}
and this is my script sources
1527060277(1)
1527060336(1)
and in test-add-tags.groovy :
ctx._source.tags+=new_tag

please help me think you
!!!!!!
and i user es in 6.2.4

Both the groovy script engine and file scripts were removed in elasticsearch 6.0. You should look at painless scripts and stored scripts.

1 Like

thank you very munch;

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