Elasticsearch upserting and appending to array

蹲街弑〆低调 提交于 2019-11-28 04:32:42

you'll want to add some array brackets to the insert part of the script.

"script": "if (ctx._source.containsKey(\"paymentInfos\")) {ctx._source.paymentInfos += paymentInfo;} else {ctx._source.paymentInfos = [paymentInfo]}"

the 'paymentInfos' property in the first section is defined as an object, so that may also be causing you to fall down.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!