# \[java api\] Trying to use groovy instead of mvel

**URL:** <https://discuss.elastic.co/t/java-api-trying-to-use-groovy-instead-of-mvel/18952>\
**Category:** Elasticsearch\
**Created:** [July 29, 2014, 3:57pm UTC](https://discuss.elastic.co/t/java-api-trying-to-use-groovy-instead-of-mvel/18952 "2014-07-29T15:57:26Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Laurent\_T](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/laurent_t/32/1133_2.png) [@Laurent\_T](https://discuss.elastic.co/u/Laurent_T)\
**Post date:** [July 29, 2014, 3:57pm UTC](https://discuss.elastic.co/t/java-api-trying-to-use-groovy-instead-of-mvel/18952/1 "2014-07-29T15:57:26Z")

</div>

Hi,

I'm upgrading my plugin to 1.3.0 from 0.90.3 and i'm having some troubles  
with my customScoreQuery that has become a functionScoreQuery.

Here's what i did: I changed the ES version to 1.3.0 in my pom.xml, adapted  
my code regarding classes and methods that did not exists anymore so it  
compiles and launched the tests.

Just to be clear, my tests are executed in local mode. My client is  
generated using  
client = NodeBuilder.nodeBuilder().local(true).node().client();

So the test about customizing the score fails with the following error: dynamic  
scripting for [mvel] disabled  
I expected that as I think i read it somewhere in the changelogs. Here's  
what the code looks like:

QueryBuilders.functionScoreQuery(theQuery).add(ScoreFunctionBuilders.scriptFunction("\_score

> - (doc['doc\_boost'].empty ? 1 : doc['doc\_boost'].value)"));

If mvel is disabled, shouldn't groovy handle this automatically ? or is my  
code not groovy-compliant ?

Anyway i thought i may need to explicitly declare i'm using groovy so i  
added "groovy" as a second parameter to my scriptFunction  
And there i got the following error: script\_lang not supported [groovy]

I tried adding the elasticsearch-lang-groovy artifact to my pom.xml but  
that only resulted in hundred of errors that looked like conflicts as if ES  
already carried groovy in it's package (which I just checked and seems to  
be the case).  
I think this is all due to the local node that may not be loading up the  
groovy plugin but i have no clue on how to do so.

Any ideas ?

Thanks  
Regards  
Laurent

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/fa033353-c2f4-4f93-87d7-6247835d43b5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fa033353-c2f4-4f93-87d7-6247835d43b5%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 29, 2014, 4:09pm UTC](https://discuss.elastic.co/t/java-api-trying-to-use-groovy-instead-of-mvel/18952/2 "2014-07-29T16:09:40Z")

</div>

Anyway i thought i may need to explicitly declare i'm using groovy so i added "groovy" as a second parameter to my scriptFunction  
And there i got the following error: script\_lang not supported [groovy]

Indeed, that's what you need to do. It should work I think. Never played with it though.

You may also need to activate explicitly dynamic scripting: [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html#\_enabling\_dynamic\_scripting](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html#_enabling_dynamic_scripting)  
Although I think it's not required here as you are using Groovy.

For sure, you don't need and you must not install groovy lang plugin. That's why we did not release it for es-1.3 by the way.

You don't have any other node connected running within your cluster I guess.

Any chance you could share your test class as a Gist?

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 29 juillet 2014 à 17:57:30, Laurent T. ([lau.thoulon@gmail.com](mailto:lau.thoulon@gmail.com)) a écrit:

Hi,

I'm upgrading my plugin to 1.3.0 from 0.90.3 and i'm having some troubles with my customScoreQuery that has become a functionScoreQuery.

Here's what i did: I changed the ES version to 1.3.0 in my pom.xml, adapted my code regarding classes and methods that did not exists anymore so it compiles and launched the tests.

Just to be clear, my tests are executed in local mode. My client is generated using  
client = NodeBuilder.nodeBuilder().local(true).node().client();

So the test about customizing the score fails with the following error: dynamic scripting for [mvel] disabled  
I expected that as I think i read it somewhere in the changelogs. Here's what the code looks like:

QueryBuilders.functionScoreQuery(theQuery).add(ScoreFunctionBuilders.scriptFunction("\_score \* (doc['doc\_boost'].empty ? 1 : doc['doc\_boost'].value)"));

If mvel is disabled, shouldn't groovy handle this automatically ? or is my code not groovy-compliant ?

Anyway i thought i may need to explicitly declare i'm using groovy so i added "groovy" as a second parameter to my scriptFunction  
And there i got the following error: script\_lang not supported [groovy]

I tried adding the elasticsearch-lang-groovy artifact to my pom.xml but that only resulted in hundred of errors that looked like conflicts as if ES already carried groovy in it's package (which I just checked and seems to be the case).  
I think this is all due to the local node that may not be loading up the groovy plugin but i have no clue on how to do so.

Any ideas ?

Thanks  
Regards  
Laurent

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/fa033353-c2f4-4f93-87d7-6247835d43b5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fa033353-c2f4-4f93-87d7-6247835d43b5%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.53d7c744.625558ec.f0d0%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.53d7c744.625558ec.f0d0%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Laurent\_T](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/laurent_t/32/1133_2.png) [@Laurent\_T](https://discuss.elastic.co/u/Laurent_T)\
**Post date:** [July 30, 2014, 8:46am UTC](https://discuss.elastic.co/t/java-api-trying-to-use-groovy-instead-of-mvel/18952/3 "2014-07-30T08:46:21Z")

</div>

Hi David,

I tried, as you suggested, to activate dynamic scripting and to force  
groovy as a default\_lang but the results stay unchanged.  
And yeah, no other node on the cluster.. Here's the test's output logs:

TestClient: Loading config files...

> TestClient: Creating local node...  
> juil. 30, 2014 10:43:39 AM org.elasticsearch.node  
> Infos: [Gardevoir] version[1.3.0], pid[6876],  
> build[1265b14/2014-07-23T13:46:36Z]  
> juil. 30, 2014 10:43:39 AM org.elasticsearch.node  
> Infos: [Gardevoir] initializing ...  
> juil. 30, 2014 10:43:39 AM org.elasticsearch.plugins  
> Infos: [Gardevoir] loaded , sites   
> juil. 30, 2014 10:43:40 AM org.elasticsearch.node  
> Infos: [Gardevoir] initialized  
> juil. 30, 2014 10:43:40 AM org.elasticsearch.node  
> Infos: [Gardevoir] starting ...  
> juil. 30, 2014 10:43:40 AM org.elasticsearch.transport  
> Infos: [Gardevoir] bound\_address {local[1]}, publish\_address {local[1]}  
> juil. 30, 2014 10:43:40 AM org.elasticsearch.discovery  
> Infos: [Gardevoir] elasticsearch/WFBIDGAJSgGjs2Pg2zCSiw  
> juil. 30, 2014 10:43:40 AM org.elasticsearch.cluster.service  
> Infos: [Gardevoir] new\_master  
> [Gardevoir][WFBIDGAJSgGjs2Pg2zCSiw][Laurent-PC][local[1]]{local=true},  
> reason: local-disco-initial\_connect(master)  
> juil. 30, 2014 10:43:40 AM org.elasticsearch.gateway  
> Infos: [Gardevoir] recovered [0] indices into cluster\_state  
> juil. 30, 2014 10:43:41 AM org.elasticsearch.http  
> Infos: [Gardevoir] bound\_address {inet[/0:0:0:0:0:0:0:0:9200]},  
> publish\_address {inet[/192.168.1.22:9200]}  
> juil. 30, 2014 10:43:41 AM org.elasticsearch.node  
> Infos: [Gardevoir] started  
> TestClient: Creating index test\_testclient...  
> juil. 30, 2014 10:43:41 AM org.elasticsearch.cluster.metadata  
> Infos: [Gardevoir] [test\_testclient] creating index, cause [api], shards  
> [1]/[0], mappings [testtype]  
> TestClient: Seeding test data...  
> TestClient: Seededjuil. 30, 2014 10:43:41 AM  
> org.elasticsearch.cluster.metadata  
> Infos: [Gardevoir] [test\_testclient] update\_mapping [testtype] (dynamic)  
> .......... 3 documents  
> TestClient: Deleting index test\_testclient...  
> TestClient: Shuting down local node... Done.

I extracted what i could from my code into this gist:

> <https://gist.github.com/Crystark/2deb118add9115bed6a6>
>
> There are more than three files. show original

I used those files in a brand new maven project and got to reproduce the  
error.

Hope you can help.  
Thanks again  
Regards,  
Laurent

On Tuesday, July 29, 2014 6:10:02 PM UTC+2, David Pilato wrote:

> Anyway i thought i may need to explicitly declare i'm using groovy so i  
> added "groovy" as a second parameter to my scriptFunction  
> And there i got the following error: script\_lang not supported [groovy]
> 
> Indeed, that's what you need to do. It should work I think. Never played  
> with it though.
> 
> You may also need to activate explicitly dynamic scripting:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html#_enabling_dynamic_scripting)  
> Although I think it's not required here as you are using Groovy.
> 
> For sure, you don't need and you must not install groovy lang plugin.  
> That's why we did not release it for es-1.3 by the way.
> 
> You don't have any other node connected running within your cluster I  
> guess.
> 
> Any chance you could share your test class as a Gist?
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 29 juillet 2014 à 17:57:30, Laurent T. ([lau.t...@gmail.com](mailto:lau.t...@gmail.com)  
> \<javascript:\>) a écrit:
> 
> Hi,
> 
> I'm upgrading my plugin to 1.3.0 from 0.90.3 and i'm having some troubles  
> with my customScoreQuery that has become a functionScoreQuery.
> 
> Here's what i did: I changed the ES version to 1.3.0 in my pom.xml,  
> adapted my code regarding classes and methods that did not exists anymore  
> so it compiles and launched the tests.
> 
> Just to be clear, my tests are executed in local mode. My client is  
> generated using  
> client = NodeBuilder.nodeBuilder().local(true).node().client();
> 
> So the test about customizing the score fails with the following error: dynamic  
> scripting for [mvel] disabled  
> I expected that as I think i read it somewhere in the changelogs. Here's  
> what the code looks like:
> 
> QueryBuilders.functionScoreQuery(theQuery).add(ScoreFunctionBuilders.scriptFunction("\_score
> 
> > - (doc['doc\_boost'].empty ? 1 : doc['doc\_boost'].value)"));
> 
> If mvel is disabled, shouldn't groovy handle this automatically ? or is my  
> code not groovy-compliant ?
> 
> Anyway i thought i may need to explicitly declare i'm using groovy so i  
> added "groovy" as a second parameter to my scriptFunction  
> And there i got the following error: script\_lang not supported [groovy]
> 
> I tried adding the elasticsearch-lang-groovy artifact to my pom.xml but  
> that only resulted in hundred of errors that looked like conflicts as if ES  
> already carried groovy in it's package (which I just checked and seems to  
> be the case).  
> I think this is all due to the local node that may not be loading up the  
> groovy plugin but i have no clue on how to do so.
> 
> Any ideas ?
> 
> Thanks  
> Regards  
> Laurent
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/fa033353-c2f4-4f93-87d7-6247835d43b5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/fa033353-c2f4-4f93-87d7-6247835d43b5%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/fa033353-c2f4-4f93-87d7-6247835d43b5%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/fa033353-c2f4-4f93-87d7-6247835d43b5%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e8db737b-1205-4c55-9f09-7045594ad0a8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e8db737b-1205-4c55-9f09-7045594ad0a8%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [July 30, 2014, 9:41am UTC](https://discuss.elastic.co/t/java-api-trying-to-use-groovy-instead-of-mvel/18952/4 "2014-07-30T09:41:14Z")

</div>

You should try to add groovy jar to your classpath. It is not in the  
dependencies in Maven's pom.xml.

Example:

```
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>2.3.5</version>
            <type>jar</type>
        </dependency>

```

Jörg

On Wed, Jul 30, 2014 at 10:46 AM, Laurent T. [lau.thoulon@gmail.com](mailto:lau.thoulon@gmail.com) wrote:

> Hi David,
> 
> I tried, as you suggested, to activate dynamic scripting and to force  
> groovy as a default\_lang but the results stay unchanged.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGTkAHvnWZLc1bzjU4f54xtT4ptJYxz4h%3DD3KAqBVEWmA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGTkAHvnWZLc1bzjU4f54xtT4ptJYxz4h%3DD3KAqBVEWmA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Laurent\_T](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/laurent_t/32/1133_2.png) [@Laurent\_T](https://discuss.elastic.co/u/Laurent_T)\
**Post date:** [July 30, 2014, 9:53am UTC](https://discuss.elastic.co/t/java-api-trying-to-use-groovy-instead-of-mvel/18952/5 "2014-07-30T09:53:43Z")

</div>

Nice catch Jörg, that indeed did the trick.

@David Shouldn't groovy be bundled in the ES jar if it's the new default ?  
Will it be provided by ES when i run on a live cluster ?

Thanks!

On Wednesday, July 30, 2014 11:41:23 AM UTC+2, Jörg Prante wrote:

> You should try to add groovy jar to your classpath. It is not in the  
> dependencies in Maven's pom.xml.
> 
> Example:
> 
> ```
> <dependency>
> <groupId>org.codehaus.groovy</groupId>
> <artifactId>groovy-all</artifactId>
> <version>2.3.5</version>
> <type>jar</type>
> </dependency>
> 
> ```
> 
> Jörg
> 
> On Wed, Jul 30, 2014 at 10:46 AM, Laurent T. \<[lau.t...@gmail.com](mailto:lau.t...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > Hi David,
> > 
> > I tried, as you suggested, to activate dynamic scripting and to force  
> > groovy as a default\_lang but the results stay unchanged.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0c285769-7872-41cd-9efe-6c97ed8d3df4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0c285769-7872-41cd-9efe-6c97ed8d3df4%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [July 30, 2014, 10:08am UTC](https://discuss.elastic.co/t/java-api-trying-to-use-groovy-instead-of-mvel/18952/6 "2014-07-30T10:08:54Z")

</div>

The ES team decided to postpone groovy as default to Elasticsearch 1.4  
version.

In 1.3, mvel is still the default, so authors have some time to rewrite  
their scripts if they prefer to. So I think it is ok to not include groovy  
jar by default, and make this optional to those who want to switch over to  
groovy.

Jörg

On Wed, Jul 30, 2014 at 11:53 AM, Laurent T. [lau.thoulon@gmail.com](mailto:lau.thoulon@gmail.com) wrote:

> Nice catch Jörg, that indeed did the trick.
> 
> @David Shouldn't groovy be bundled in the ES jar if it's the new default ?  
> Will it be provided by ES when i run on a live cluster ?
> 
> Thanks!
> 
> On Wednesday, July 30, 2014 11:41:23 AM UTC+2, Jörg Prante wrote:
> 
> > You should try to add groovy jar to your classpath. It is not in the  
> > dependencies in Maven's pom.xml.
> > 
> > Example:
> > 
> > ```
> > <dependency>
> > <groupId>org.codehaus.groovy</groupId>
> > <artifactId>groovy-all</artifactId>
> > <version>2.3.5</version>
> > <type>jar</type>
> > </dependency>
> > 
> > ```
> > 
> > Jörg
> > 
> > On Wed, Jul 30, 2014 at 10:46 AM, Laurent T. [lau.t...@gmail.com](mailto:lau.t...@gmail.com) wrote:
> > 
> > > Hi David,
> > > 
> > > I tried, as you suggested, to activate dynamic scripting and to force  
> > > groovy as a default\_lang but the results stay unchanged.
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/0c285769-7872-41cd-9efe-6c97ed8d3df4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0c285769-7872-41cd-9efe-6c97ed8d3df4%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/0c285769-7872-41cd-9efe-6c97ed8d3df4%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/0c285769-7872-41cd-9efe-6c97ed8d3df4%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG9mwEK\_65v084icNeLvtk2S6eEwk4cPu2sZNXCPDgZ0Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG9mwEK_65v084icNeLvtk2S6eEwk4cPu2sZNXCPDgZ0Q%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 30, 2014, 10:29am UTC](https://discuss.elastic.co/t/java-api-trying-to-use-groovy-instead-of-mvel/18952/7 "2014-07-30T10:29:55Z")

</div>

Ha! Right! Thanks Jörg!

I forgot that I run the same "issue" recently. I should add more memory to my brain cluster 🙂

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 30 juillet 2014 à 12:08:58, [joergprante@gmail.com](mailto:joergprante@gmail.com) ([joergprante@gmail.com](mailto:joergprante@gmail.com)) a écrit:

The ES team decided to postpone groovy as default to Elasticsearch 1.4 version.

In 1.3, mvel is still the default, so authors have some time to rewrite their scripts if they prefer to. So I think it is ok to not include groovy jar by default, and make this optional to those who want to switch over to groovy.

Jörg

On Wed, Jul 30, 2014 at 11:53 AM, Laurent T. [lau.thoulon@gmail.com](mailto:lau.thoulon@gmail.com) wrote:  
Nice catch Jörg, that indeed did the trick.

@David Shouldn't groovy be bundled in the ES jar if it's the new default ?  
Will it be provided by ES when i run on a live cluster ?

Thanks!

On Wednesday, July 30, 2014 11:41:23 AM UTC+2, Jörg Prante wrote:  
You should try to add groovy jar to your classpath. It is not in the dependencies in Maven's pom.xml.

Example:

```
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>2.3.5</version>
            <type>jar</type>
        </dependency>

```

Jörg

On Wed, Jul 30, 2014 at 10:46 AM, Laurent T. [lau.t...@gmail.com](mailto:lau.t...@gmail.com) wrote:  
Hi David,

## I tried, as you suggested, to activate dynamic scripting and to force groovy as a default\_lang but the results stay unchanged.

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0c285769-7872-41cd-9efe-6c97ed8d3df4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0c285769-7872-41cd-9efe-6c97ed8d3df4%40googlegroups.com).

For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG9mwEK\_65v084icNeLvtk2S6eEwk4cPu2sZNXCPDgZ0Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG9mwEK_65v084icNeLvtk2S6eEwk4cPu2sZNXCPDgZ0Q%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.53d8c924.4516dde9.f0d0%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.53d8c924.4516dde9.f0d0%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Laurent\_T](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/laurent_t/32/1133_2.png) [@Laurent\_T](https://discuss.elastic.co/u/Laurent_T)\
**Post date:** [July 30, 2014, 11:19am UTC](https://discuss.elastic.co/t/java-api-trying-to-use-groovy-instead-of-mvel/18952/8 "2014-07-30T11:19:17Z")

</div>

Ok well, anyway i think you may want to update the docs about this cause i  
think i won't be the only one facing this 🙂  
Thanks again to both of you.

On Wednesday, July 30, 2014 12:30:09 PM UTC+2, David Pilato wrote:

> Ha! Right! Thanks Jörg!
> 
> I forgot that I run the same "issue" recently. I should add more memory to  
> my brain cluster 🙂
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 30 juillet 2014 à 12:08:58, [joerg...@gmail.com](mailto:joerg...@gmail.com) \<javascript:\> (  
> [joerg...@gmail.com](mailto:joerg...@gmail.com) \<javascript:\>) a écrit:
> 
> The ES team decided to postpone groovy as default to Elasticsearch 1.4  
> version.
> 
> In 1.3, mvel is still the default, so authors have some time to rewrite  
> their scripts if they prefer to. So I think it is ok to not include groovy  
> jar by default, and make this optional to those who want to switch over to  
> groovy.
> 
> Jörg
> 
> On Wed, Jul 30, 2014 at 11:53 AM, Laurent T. \<[lau.t...@gmail.com](mailto:lau.t...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > Nice catch Jörg, that indeed did the trick.
> > 
> > @David Shouldn't groovy be bundled in the ES jar if it's the new default ?  
> > Will it be provided by ES when i run on a live cluster ?
> > 
> > Thanks!
> > 
> > On Wednesday, July 30, 2014 11:41:23 AM UTC+2, Jörg Prante wrote:
> > 
> > > You should try to add groovy jar to your classpath. It is not in the  
> > > dependencies in Maven's pom.xml.
> > > 
> > > Example:
> > > 
> > > ```
> > > <dependency>
> > > <groupId>org.codehaus.groovy</groupId>
> > > <artifactId>groovy-all</artifactId>
> > > <version>2.3.5</version>
> > > <type>jar</type>
> > > </dependency>
> > > 
> > > ```
> > > 
> > > Jörg
> > > 
> > > On Wed, Jul 30, 2014 at 10:46 AM, Laurent T. [lau.t...@gmail.com](mailto:lau.t...@gmail.com) wrote:
> > > 
> > > > Hi David,
> > > > 
> > > > I tried, as you suggested, to activate dynamic scripting and to force  
> > > > groovy as a default\_lang but the results stay unchanged.
> > > 
> > > ```
> > > --
> > > 
> > > ```
> > 
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/0c285769-7872-41cd-9efe-6c97ed8d3df4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0c285769-7872-41cd-9efe-6c97ed8d3df4%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/0c285769-7872-41cd-9efe-6c97ed8d3df4%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/0c285769-7872-41cd-9efe-6c97ed8d3df4%40googlegroups.com?utm_medium=email&utm_source=footer).
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG9mwEK\_65v084icNeLvtk2S6eEwk4cPu2sZNXCPDgZ0Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG9mwEK_65v084icNeLvtk2S6eEwk4cPu2sZNXCPDgZ0Q%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG9mwEK\_65v084icNeLvtk2S6eEwk4cPu2sZNXCPDgZ0Q%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG9mwEK_65v084icNeLvtk2S6eEwk4cPu2sZNXCPDgZ0Q%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b0339bd4-5009-418f-8b97-eca21eda0089%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b0339bd4-5009-418f-8b97-eca21eda0089%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Laurent\_T](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/laurent_t/32/1133_2.png) [@Laurent\_T](https://discuss.elastic.co/u/Laurent_T)\
**Post date:** [July 30, 2014, 3:55pm UTC](https://discuss.elastic.co/t/java-api-trying-to-use-groovy-instead-of-mvel/18952/9 "2014-07-30T15:55:53Z")

</div>

Just FYI, if anyone else runs into the same troubles, Groovy seems to be  
provided on a real cluster and it's in version 2.3.2.

On Wednesday, July 30, 2014 1:19:17 PM UTC+2, Laurent T. wrote:

> Ok well, anyway i think you may want to update the docs about this cause i  
> think i won't be the only one facing this 🙂  
> Thanks again to both of you.
> 
> On Wednesday, July 30, 2014 12:30:09 PM UTC+2, David Pilato wrote:
> 
> > Ha! Right! Thanks Jörg!
> > 
> > I forgot that I run the same "issue" recently. I should add more memory  
> > to my brain cluster 🙂
> > 
> > --  
> > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> > [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> > 
> > Le 30 juillet 2014 à 12:08:58, [joerg...@gmail.com](mailto:joerg...@gmail.com) ([joerg...@gmail.com](mailto:joerg...@gmail.com)) a  
> > écrit:
> > 
> > The ES team decided to postpone groovy as default to Elasticsearch 1.4  
> > version.
> > 
> > In 1.3, mvel is still the default, so authors have some time to rewrite  
> > their scripts if they prefer to. So I think it is ok to not include groovy  
> > jar by default, and make this optional to those who want to switch over to  
> > groovy.
> > 
> > Jörg
> > 
> > On Wed, Jul 30, 2014 at 11:53 AM, Laurent T. [lau.t...@gmail.com](mailto:lau.t...@gmail.com) wrote:
> > 
> > > Nice catch Jörg, that indeed did the trick.
> > > 
> > > @David Shouldn't groovy be bundled in the ES jar if it's the new default  
> > > ?  
> > > Will it be provided by ES when i run on a live cluster ?
> > > 
> > > Thanks!
> > > 
> > > On Wednesday, July 30, 2014 11:41:23 AM UTC+2, Jörg Prante wrote:
> > > 
> > > > You should try to add groovy jar to your classpath. It is not in the  
> > > > dependencies in Maven's pom.xml.
> > > > 
> > > > Example:
> > > > 
> > > > ```
> > > > <dependency>
> > > > <groupId>org.codehaus.groovy</groupId>
> > > > <artifactId>groovy-all</artifactId>
> > > > <version>2.3.5</version>
> > > > <type>jar</type>
> > > > </dependency>
> > > > 
> > > > ```
> > > > 
> > > > Jörg
> > > > 
> > > > On Wed, Jul 30, 2014 at 10:46 AM, Laurent T. [lau.t...@gmail.com](mailto:lau.t...@gmail.com)  
> > > > wrote:
> > > > 
> > > > > Hi David,
> > > > > 
> > > > > I tried, as you suggested, to activate dynamic scripting and to force  
> > > > > groovy as a default\_lang but the results stay unchanged.
> > > > 
> > > > ```
> > > > --
> > > > 
> > > > ```
> > > 
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/0c285769-7872-41cd-9efe-6c97ed8d3df4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0c285769-7872-41cd-9efe-6c97ed8d3df4%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/0c285769-7872-41cd-9efe-6c97ed8d3df4%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/0c285769-7872-41cd-9efe-6c97ed8d3df4%40googlegroups.com?utm_medium=email&utm_source=footer).
> > > 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG9mwEK\_65v084icNeLvtk2S6eEwk4cPu2sZNXCPDgZ0Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG9mwEK_65v084icNeLvtk2S6eEwk4cPu2sZNXCPDgZ0Q%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG9mwEK\_65v084icNeLvtk2S6eEwk4cPu2sZNXCPDgZ0Q%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG9mwEK_65v084icNeLvtk2S6eEwk4cPu2sZNXCPDgZ0Q%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/6f8752e8-3b2f-40f1-b274-6a94558cf7ec%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6f8752e8-3b2f-40f1-b274-6a94558cf7ec%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 30, 2014, 6:23pm UTC](https://discuss.elastic.co/t/java-api-trying-to-use-groovy-instead-of-mvel/18952/10 "2014-07-30T18:23:25Z")

</div>

It is!

The issue you run into is "just" a Java dependency issue. Clients don't need for example to have Groovy. That's the reason it's marked as optional dependency.

Best.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 30 juil. 2014 à 17:55, "Laurent T." [lau.thoulon@gmail.com](mailto:lau.thoulon@gmail.com) a écrit :
> 
> Just FYI, if anyone else runs into the same troubles, Groovy seems to be provided on a real cluster and it's in version 2.3.2.
> 
> > On Wednesday, July 30, 2014 1:19:17 PM UTC+2, Laurent T. wrote:  
> > Ok well, anyway i think you may want to update the docs about this cause i think i won't be the only one facing this 🙂  
> > Thanks again to both of you.
> > 
> > > On Wednesday, July 30, 2014 12:30:09 PM UTC+2, David Pilato wrote:  
> > > Ha! Right! Thanks Jörg!
> > > 
> > > I forgot that I run the same "issue" recently. I should add more memory to my brain cluster 🙂
> > > 
> > > --  
> > > David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
> > > @dadoonet | @elasticsearchfr
> > > 
> > > > Le 30 juillet 2014 à 12:08:58, [joerg...@gmail.com](mailto:joerg...@gmail.com) ([joerg...@gmail.com](mailto:joerg...@gmail.com)) a écrit:
> > > > 
> > > > The ES team decided to postpone groovy as default to Elasticsearch 1.4 version.
> > > > 
> > > > In 1.3, mvel is still the default, so authors have some time to rewrite their scripts if they prefer to. So I think it is ok to not include groovy jar by default, and make this optional to those who want to switch over to groovy.
> > > > 
> > > > Jörg
> > > > 
> > > > > On Wed, Jul 30, 2014 at 11:53 AM, Laurent T. [lau.t...@gmail.com](mailto:lau.t...@gmail.com) wrote:  
> > > > > Nice catch Jörg, that indeed did the trick.
> > > > > 
> > > > > @David Shouldn't groovy be bundled in the ES jar if it's the new default ?  
> > > > > Will it be provided by ES when i run on a live cluster ?
> > > > > 
> > > > > Thanks!
> > > > > 
> > > > > > On Wednesday, July 30, 2014 11:41:23 AM UTC+2, Jörg Prante wrote:  
> > > > > > You should try to add groovy jar to your classpath. It is not in the dependencies in Maven's pom.xml.
> > > > > > 
> > > > > > Example:
> > > > > > 
> > > > > > ```
> > > > > > <dependency>
> > > > > > <groupId>org.codehaus.groovy</groupId>
> > > > > > <artifactId>groovy-all</artifactId>
> > > > > > <version>2.3.5</version>
> > > > > > <type>jar</type>
> > > > > > </dependency>
> > > > > > 
> > > > > > ```
> > > > > > 
> > > > > > Jörg
> > > > > > 
> > > > > > > On Wed, Jul 30, 2014 at 10:46 AM, Laurent T. [lau.t...@gmail.com](mailto:lau.t...@gmail.com) wrote:  
> > > > > > > Hi David,
> > > > > > > 
> > > > > > > I tried, as you suggested, to activate dynamic scripting and to force groovy as a default\_lang but the results stay unchanged.  
> > > > > > > --  
> > > > > > > You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> > > > > > > To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0c285769-7872-41cd-9efe-6c97ed8d3df4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0c285769-7872-41cd-9efe-6c97ed8d3df4%40googlegroups.com).
> > > > > 
> > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG9mwEK\_65v084icNeLvtk2S6eEwk4cPu2sZNXCPDgZ0Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG9mwEK_65v084icNeLvtk2S6eEwk4cPu2sZNXCPDgZ0Q%40mail.gmail.com).  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/6f8752e8-3b2f-40f1-b274-6a94558cf7ec%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6f8752e8-3b2f-40f1-b274-6a94558cf7ec%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/03648E8D-AB08-4603-B014-78B273A947F5%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/03648E8D-AB08-4603-B014-78B273A947F5%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:12am UTC](https://discuss.elastic.co/t/java-api-trying-to-use-groovy-instead-of-mvel/18952/11 "2017-07-06T01:12:10Z")

</div>


