Skip to content

Commit

Permalink
Use groovy as default scripting language
Browse files Browse the repository at this point in the history
As for elasticsearch 1.3.0, `groovy` is the new default scripting language.

Related to: elastic/elasticsearch#6233

Closes #61.
(cherry picked from commit 170a2cd)
  • Loading branch information
dadoonet committed Jul 18, 2014
1 parent 393fdfa commit 7031926
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -98,7 +98,7 @@ change (for example, **ctx.doc** will refer to the document, or **ctx.deleted**
Any other [script language supported by Elasticsearch](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-plugins.html#scripting)
may be used by setting the `script_type` parameter to the appropriate value.

If unspecified, the default is `mvel`.
If unspecified, the default is `groovy`.
See [Scripting documentation](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html) for details.

The **ctx.doc** can be changed and its value can will be indexed (assuming its not a deleted change).
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Expand Up @@ -62,6 +62,12 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.3.2</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.elasticsearch</groupId>
Expand Down
Expand Up @@ -140,7 +140,7 @@ public CouchdbRiver(RiverName riverName, RiverSettings settings, @RiverIndexName
}

if (couchSettings.containsKey("script")) {
String scriptType = "mvel";
String scriptType = "groovy";
if(couchSettings.containsKey("script_type")) {
scriptType = couchSettings.get("script_type").toString();
}
Expand Down

0 comments on commit 7031926

Please sign in to comment.