ElasticSearch:内部动态脚本编译过多,最大限制错误

q35jwt9p  于 2023-03-29  发布在  ElasticSearch
关注(0)|答案(1)|浏览(360)

当我试图在elastci搜索上运行更新时,我遇到了下面的异常,
{“log.time”:“2023-03-21 06:53:18.817”,“log.level”:“ERROR”,“message”:“更新文档出错:Elasticsearch exception [type=general_script_exception,reason=无法使用lang [painless]]编译内联脚本;nested:ElasticsearchException[Elasticsearch exception [type=circuit_breaking_exception,reason=[script] Too many dynamic script compilations within,max:[75/5 m];请使用索引或带参数的脚本;此限制可以通过[script.context.update.max_compilations_rate]设置更改]];“,“error.stack_trace”:“org.springframework.data.elasticsearch.UncategorizedElasticsearchException:Elasticsearch异常[type=general_script_exception,reason=无法内联编译 org.springframework.data.elasticsearch.core.ElasticsearchExceptionTranslator.translateExceptionIfPossible(ElasticsearchExceptionTranslator.java:66)\n\达特org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.translateException(ElasticsearchRestTemplate.java:402)\n\tat org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.execute(ElasticsearchRestTemplate.java:385)\n\tat我对任何字段都使用了参数,因此传递固定字段/值没有问题。
我想知道是否有任何方法来解决这个问题,除了增加限制,为什么会发生这种情况?我做了一些更改查询,它工作正常后,但没有找到任何解决方案,这个错误。

ffdz8vbo

ffdz8vbo1#

我以前也遇到过这个错误。但原因是因为我当时没有传递参数。
这个问题可以通过在脚本中引入参数来解决
如果不是这样的话,是不是因为动态脚本变化很大?例如,你有不同的脚本被发送到ES在某个时间。如果是这样,可以考虑使用存储脚本

相关问题