Over the past couple of weeks I have improved the scripting support in
elasticsearch, with the main feature of supporting more languages then the
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
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.