ES:将当前单据保存到子字段中作为历史修订
我正在尝试使用ES:将当前单据保存到子字段中作为历史修订,
Warning: implode(): Invalid arguments passed in /data/phpspider/zhask/webroot/tpl/detail.html on line 45
,,我正在尝试使用无痛脚本实现: curl -XPOST http://127.1:9200/index1/type1/docid/_update -d \ {"script": {"inline": "ctx._source.previous.add(ctx._source)"}} 答案是 { "error": { "root_cause": [{ "type": "remote_transport_exception",
无痛脚本实现:
curl -XPOST http://127.1:9200/index1/type1/docid/_update -d \
{"script": {"inline": "ctx._source.previous.add(ctx._source)"}}
答案是
{
"error": {
"root_cause": [{
"type": "remote_transport_exception",
"reason": "[DJxHoBx][172.17.0.2:9300][indices:data/write/update[s]]"
}],
"type": "illegal_argument_exception",
"reason": "Object has already been built and is self-referencing itself"
},
"status": 400
}
那么,我如何才能使这项工作 通过手动枚举每个键来解决:
ctx.\u source['previous'].add({'x':ctx.\u source.x})
我认为URL应该是index1/type1/docid/\u update
@Val抱歉输入错误。我编辑过。我认为ctx.source
应该是ctx.\u source
,对吗?您可能还需要删除添加到previous
@Val中的旧版本中的ctx.\u source.previous
字段,这是一个很好的洞察!现在我需要找到一种方法来subMap()或排除HashLinkedList中的一个字段,以便轻松编写脚本。。。。。