Tag: elasticsearch mvel

从数组弹性search中删除对象

我需要从满足条件的数组中删除对象,我可以根据条件更新数组的对象,如下所示: PUT twitter/twit/1 {"list": [ { "tweet_id": "1", "a": "b" }, { "tweet_id": "123", "a": "f" } ] } POST /twitter/twit/1/_update {"script":"foreach (item :ctx._source.list) { if item['tweet_id'] == tweet_id) { item['new_field'] = 'ghi'; } }", "params": {tweet_id": 123"} } 这是工作 删除我正在做这个 POST /twitter/twit/1/_update { "script": "foreach (item : ctx._source.list) { if item['tweet_id'] == tweet_id) { […]