# Scripting Enhancements: more langs, better performance

**URL:** https://discuss.elastic.co/t/scripting-enhancements-more-langs-better-performance/3441
**Category:** Elasticsearch
**Created:** [October 14, 2010, 2:26pm UTC](https://discuss.elastic.co/t/scripting-enhancements-more-langs-better-performance/3441 "2010-10-14T14:26:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [October 14, 2010, 2:26pm UTC](https://discuss.elastic.co/t/scripting-enhancements-more-langs-better-performance/3441/1 "2010-10-14T14:26:32Z")

</div>

Hi,

Over the past couple of weeks I have improved the scripting support in  
elasticsearch, with the main feature of supporting more languages then the  
default mvel. The current list of supported langs are: JavaScript, Python,  
and Groovy.

Now, any component in elasticsearch (custom\_score query, facets, and so  
on) also accepts a lang (on the same level as the script) where the language  
can be chosen. The default lang to use when non is configured can be defined  
by setting script.default\_lang. The default is mvel.

In addition, there is now an option to define scripts within the node  
config folder, so they will be precompiled and registered under a short  
name, which can then be used to define the script (no lang required when  
using it). This means there is no need to pass the full script around. It is  
explained here:  
[http://github.com/elasticsearch/elasticsearch/issues/closed#issue/429](http://github.com/elasticsearch/elasticsearch/issues/closed#issue/429).

Out of the languages I wanted to support was also ruby using jruby, but  
it proved to be more difficult than expected, we'll see if it gets in once  
the jruby community answers anything on the mailing list...., it it works  
the way I think it does, than its problematic.

There has been a lot of work going into executing scripts as fast as  
possible, optimized to the nature of how they are executed within  
elasticsearch. Also, once this building block is in, I hope to sprinkle  
scripts in more places across the codebase.

-shay.banon

---

<div class="post-metadata">

### Author: ![James\_Cook](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@James\_Cook](https://discuss.elastic.co/u/James_Cook)
#### Post date: [October 14, 2010, 4:35pm UTC](https://discuss.elastic.co/t/scripting-enhancements-more-langs-better-performance/3441/2 "2010-10-14T16:35:20Z")

</div>

We use Javascript end-to-end, so it would be great to see this added. This  
is especially useful given the internal JSON format.

-- jim

On Thu, Oct 14, 2010 at 10:26 AM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> Hi,
> 
> Over the past couple of weeks I have improved the scripting support in  
> elasticsearch, with the main feature of supporting more languages then the  
> default mvel. The current list of supported langs are: JavaScript, Python,  
> and Groovy.
> 
> Now, any component in elasticsearch (custom\_score query, facets, and so  
> on) also accepts a lang (on the same level as the script) where the language  
> can be chosen. The default lang to use when non is configured can be defined  
> by setting script.default\_lang. The default is mvel.
> 
> In addition, there is now an option to define scripts within the node  
> config folder, so they will be precompiled and registered under a short  
> name, which can then be used to define the script (no lang required when  
> using it). This means there is no need to pass the full script around. It is  
> explained here:  
> [Issues · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/closed#issue/429).
> 
> Out of the languages I wanted to support was also ruby using jruby, but  
> it proved to be more difficult than expected, we'll see if it gets in once  
> the jruby community answers anything on the mailing list...., it it works  
> the way I think it does, than its problematic.
> 
> There has been a lot of work going into executing scripts as fast as  
> possible, optimized to the nature of how they are executed within  
> elasticsearch. Also, once this building block is in, I hope to sprinkle  
> scripts in more places across the codebase.
> 
> -shay.banon

---

<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, 4:18am UTC](https://discuss.elastic.co/t/scripting-enhancements-more-langs-better-performance/3441/3 "2017-07-06T04:18:00Z")

</div>


