Testing 2.3.0 - script_lang not supported [groovy]

<dependency>
  <groupId>org.codehaus.groovy</groupId>
  <artifactId>groovy-all</artifactId>
  <version>2.4.6</version>
</dependency>

Configuration:

            .put("script.inline", true)
            .put("script.indexed", true)
            .put("script.update", true)
            .put("script.search", true)
            .put("script.engine.groovy.indexed.aggs", true)
            .put("script.engine.groovy.indexed.search", true)
            .put("script.engine.groovy.indexed.update", true)
            .put("script.engine.groovy.indexed.plugin", true);

Exception:

java.lang.IllegalArgumentException: script_lang not supported [groovy]
at org.elasticsearch.script.ScriptService.validateScriptLanguage(ScriptService.java:337)
at org.elasticsearch.script.ScriptService.putScriptToIndex(ScriptService.java:392)

I set a breakpoint in ScriptService and I can see it has the correct configuration but the only supported language it has is "native"

Here is code triggering it:

    client.preparePutIndexedScript()
            .setScriptLang("groovy")
            .setId("asset_append_export")
            .setSource(script1)
            .get();

Figured it out, I forgot about this. ElasticSearch 2.2+ no longer supports embedded client with plugins compiled into the same war/jar. It really sucks because it was a really cool when it worked. You could basically combine elastic, spring boot, and a bunch of custom plugins to make standalone clusterable application servers that you could deploy as a single jar file.

You can get away with it up to 2.1 which is I guess where all my software is now stuck.

1 Like