我正在尝试将以下查询发送给Elasticsearch。这是通过查询进行的最小更新,这给了我异常(exception)。让我们将其命名为Query1:
{ "id": "someID", "script": { "lang": "painless", "source": " if (ctx._source.containsKey('value')) { ctx._source.value = ctx._source.value + params.value; }" }, "params": { "value": 1 }, "upsert": { "value": 1 }}
一直试图寻找这个问题已有一段时间。在我们的例子中,参数值被索引为integer。它本身的查询是作为批量API的一部分发送的。如下所示:
{update: {_id:"someID", _index:"someIndex", _type:"someType"}}(Query1)
尝试运行脚本时,它将具有运行时异常:
null_point_exception
params.value ^--- here
我见过related问题,但没有解决方案。在堆栈溢出和其他站点。

最佳答案

在 flex 论坛中提问。参数不在脚本内。

10-06 09:57
查看更多