Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ES:将当前单据保存到子字段中作为历史修订 - Fatal编程技术网

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中的一个字段,以便轻松编写脚本。。。。。