gpt4 book ai didi

elasticsearch - 使用更新脚本时出现ElasticsearchIllegalArgumentException

转载 作者:行者123 更新时间:2023-12-02 23:03:11 26 4
gpt4 key购买 nike

我在Heroku上使用Bonsai Elastic Search,并且我的文档如下:

{
"_index":"myIndex",
"_type":"result",
"_id":"1234_is",
"_version":1,
"found":true,
"_source":{
"query":"is",
"pubId":1234,
"counter":1
}
}

我正在尝试像这样更新计数器(按照 http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/docs-update.html):
curl -XPOST 'http://ELASTICSEARCHINSTANCE:9200/myIndex/result/1234_is/_update' -d '{"script" : "ctx._source.counter+=1"}'

但我收到以下错误:
{
"error":"ElasticsearchIllegalArgumentException[failed to execute script]; nested: ExpressionScriptCompilationException[Failed to parse expression: ctx._source.counter+=1]; nested: ParseException[ unexpected character '1' at position (21).]; nested: MismatchedTokenException; ",
"status":400
}

最佳答案

盆景创始人在这里。

出于安全原因,Bonsai仅在其 Multi-Tenancy 环境中支持使用沙盒语言进行动态脚本编写。在CVE-2015-1427和Elasticsearch 1.4.3 and 1.3.8发行之后​​,对于Elasticsearch中的沙盒动态脚本,不再将Groovy视为安全语言。

也就是说,Groovy在Bonsai的单租户集群上是绝对安全的,请给我们发邮件至info@bonsai.io以获取此类设置的报价。

关于elasticsearch - 使用更新脚本时出现ElasticsearchIllegalArgumentException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28829502/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com