Map<String, Object> params = new HashMap<String, Object>();
params.put("message2", "22345678dddd91");
updateRequest.script(new Script(Script.DEFAULT_SCRIPT_TYPE, Script.DEFAULT_SCRIPT_LANG, "def message2 =''; ctx._source.message2 = message2;",params));
为什么params不生效, message2的信息为空。另外看官网的使用是:
client.prepareUpdate("ttl", "doc", "1") .setScript(new Script("ctx._source.gender = \"male\"" , ScriptService.ScriptType.INLINE, null, null)) .get();
Scripti没有这个构造方法啊。我的版本是5.5.2看的文档是5.5
1 个回复
jianwwei
赞同来自: