Register engines with a default of `ScriptMode.ON`
Original commit: elastic/x-pack-elasticsearch@d367b4028e
This commit is contained in:
parent
6e70856cf5
commit
fd6cf7d3d3
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
package org.elasticsearch.script;
|
||||
|
||||
import org.elasticsearch.script.ScriptMode;
|
||||
import org.elasticsearch.xpack.common.text.DefaultTextTemplateEngine;
|
||||
|
||||
import java.util.Collections;
|
||||
|
@ -29,7 +30,7 @@ public class MockMustacheScriptEngine extends MockScriptEngine {
|
|||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(MockMustacheScriptEngine.class,
|
||||
Collections.singletonList(NAME)));
|
||||
Collections.singletonList(NAME), ScriptMode.ON));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ package org.elasticsearch.script;
|
|||
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.script.ScriptMode;
|
||||
import org.elasticsearch.search.lookup.SearchLookup;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -39,7 +40,7 @@ public class SleepScriptEngine implements ScriptEngineService {
|
|||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(SleepScriptEngine.class, SleepScriptEngine.TYPES));
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(SleepScriptEngine.class, SleepScriptEngine.TYPES, ScriptMode.ON));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue