我想更新一个给定的文档;使用保存的脚本
curl -XPOST 'http://localhost:9200/customer92/listbuilder/a10/_update' -d '
{
"_script": {
"script":"summarization"
}
}'我的summarization.groovy /scripts文件夹中有一个脚本。我收到以下错误:
{
"error":
"ElasticsearchIllegalArgumentException[failed to execute script]; nested:
GroovyScriptExecutionException[MissingPropertyException[No such property:
summarization for class: Script6]]; ",
"status":400
}我做错了什么?
发布于 2014-12-11 15:21:45
编辑: Elasticsearch自从这个答案(来自文档)以来发生了很大的变化。请参考最新文档,例如https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html#_indexed_scripts
我很确定这个问题已经不再重要了,但如果有人仍然感兴趣,这里可以这样说:
json中的" script“字段应该是实际的脚本,而不是脚本的名称。在您的示例中,script_id应该是正确的,而且应该添加语言的名称,除非更改了缺省值。
curl -XPOST 'http://localhost:9200/customer92/listbuilder/a10/_update' -d ' { "script_id":"summarization", "lang": "groovy" }'
有关详细信息,请参阅:Indexed Scripts和Update API
https://stackoverflow.com/questions/25415375
复制相似问题