Reputation: 1
While I was try to run update by query on elastci search I got below exception,
`{"log.time":"2023-03-21 06:53:18.817","log.level":"ERROR","message":"error in updating documents: Elasticsearch exception [type=general_script_exception, reason=Failed to compile inline script using lang [painless]]]; nested: ElasticsearchException[Elasticsearch exception [type=circuit_breaking_exception, reason=[script] Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.context.update.max_compilations_rate] setting]];","error.stack_trace":"org.springframework.data.elasticsearch.UncategorizedElasticsearchException: Elasticsearch exception [type=general_script_exception, reason=Failed to compile inline
org.springframework.data.elasticsearch.core.ElasticsearchExceptionTranslator.translateExceptionIfPossible(ElasticsearchExceptionTranslator.java:66)\n\tat org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.translateException(ElasticsearchRestTemplate.java:402)\n\tat org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.execute(ElasticsearchRestTemplate.java:385)\n\tat ` I was using params for any field, so no issues passing fixed field/value.
I want to know is there any way to fix this beside increasing limit and why this happens? I made some changes to query and it worked fine later, but didn't find any solution for this error.
Upvotes: 0
Views: 807
Reputation: 16
I also encountered this error before. But the reason is because I was not passing parameter at that moment.
The issue be resolved by introducing parameters to script
If this is not the case, does it because the dynamic script variations are large? eg. you have different scripts been send to ES at certain time. If so, can consider to use stored script
Upvotes: 0