Skip to content

Instantly share code, notes, and snippets.

@hkorte
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hkorte/6efadb547b55976ae466 to your computer and use it in GitHub Desktop.
Save hkorte/6efadb547b55976ae466 to your computer and use it in GitHub Desktop.
Elasticsearch 1.3.1 in-memory with groovy support

Recently I was upgrading from Elasticsearch 1.1.1 to 1.3.1 and I wanted to change a dynamic script from MVEL to Groovy as MVEL is not sandboxed and thus deprecated. While all my manual tests on a standalone ES 1.3.1 worked perfectly, my automated tests running an in-memory ES node kept on failing with:

ElasticsearchIllegalArgumentException[script_lang not supported [groovy]];

I then changed the log level and saw this:

DEBUG org.elasticsearch.script - [Spymaster] failed to load groovy
java.lang.ClassNotFoundException: groovy.lang.GroovyClassLoader

So the solution was simply to add the same groovy dependency to my pom file as was in the lib folder of the standalone ES installation:

<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>2.3.2</version>
    <scope>test</scope>
</dependency>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment