我想运行示例更新
curl -XPOST 'localhost:9200/test/type1/1/_update' -d '{
"script" : "ctx._source.text = \"some text\""
}'
Run Code Online (Sandbox Code Playgroud)
(http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-update.html),但收到了错误{"error":"ElasticsearchIllegalArgumentException[failed to execute script]; nested: ScriptException[dynamic scripting for [mvel] disabled]; ","status":400}.
从这个页面http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html,我发现我需要放置我的脚本(我称之为demorun.groovy)并按名称运行它.我做到了,现在尝试引用为
curl -XPOST 'localhost:9200/test/type1/1/_update' -d '{
"script" : "demorun.groovy"
}'
Run Code Online (Sandbox Code Playgroud)
但仍然得到相同的错误.我想这是错误的.如何使用外部脚本传递_update?
我的demorun.groovy:
ctx._source.text = \"some text\"
Run Code Online (Sandbox Code Playgroud) 我正在开发一个使用Spring框架和Jackson的项目.但是,我无法找到一个插入的地方.我查看了Web上的许多示例,其中大多数使用类的bean org.springframework.http.converter.json.MappingJacksonHttpMessageConverter来允许反序列化@ResponseBody.所以,我无法找到任何引用MappingJacksonHttpMessageConverter.
我的问题:Spring框架会自动使用Jackson,如果它会在类路径中找到它将JSON转换为@ResponseBody对象吗?
如何启用杰克逊的其他方式是什么?