Error while creating big script inline or stored

Hi Team,

While trying to create inline or stored script with bigger data, we are getting below exception.
Caused by: ScriptException[compile error]; nested: IllegalArgumentException[Scripts may be no longer than 16384 characters. The passed in script is 61551 characters. Consider using a plugin if a script longer than this length is a requirement.];
at org.elasticsearch.painless.PainlessScriptEngineService.convertToScriptException(PainlessScriptEngineService.java:264)
at org.elasticsearch.painless.PainlessScriptEngineService.compile(PainlessScriptEngineService.java:176)
at org.elasticsearch.script.ScriptService.validateStoredScript(ScriptService.java:389)

I was just wondering is there any setting where I can increase this limit, please suggest.

Referring through the code I found class org.elasticsearch.painless.Compiler have hard coded field MAXIMUM_SOURCE_LENGTH with 16384 value. In compile method of this class there is below check which is causing this exception.
if (source.length() > MAXIMUM_SOURCE_LENGTH)

Is there any way to avoid this error.

In our use case script size may vary and not in our full control and we want to create pipeline with script on the fly like we create any type in any index.

Please share your thoughts.

Understanding : In case of stored script by default size limit is 65,535 bytes which can be change by setting script.max_size_in_bytes. However compiler has limit of 16384 , then what is the use of this setting.

Any thing I am missing here?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.