Hi board !
I'v been trying to use an custom sort script using mvel, all went well
until I started working with arrays.
I did some research and found that issuehttps://github.com/elasticsearch/elasticsearch/pull/2291on the tracker, it doesn't looks like a fix will be available soon.
Apparently one of the workaround is to use another lang for the script, so
I tried the javascript one: can't get it working.
I suppose (hope) I've missed a step or did something wrong - I'm on Ubuntu
12.04:
- sudo elasticsearch/bin/plugin -install
elasticsearch/elasticsearch-lang-javascript - put "plugin.mandatory: lang-javascript" in
/etc/elasticsearch/elasticsearch.yaml to make sure the plugin is here and
correctly installed - sudo service elasticsearch stop (then start)
The logs mention the plugin:
[2012-11-09 10:20:16,784][INFO ][plugins ] [Sekhmet]loaded
[], sites [lang-javascript]
But whenever I try a script query, I receive that answer:
script_lang not supported [js]
Here is a query sample:
{
"query": {
"term":{
"user":"nico"
}
},
"sort": {
"_script":{
"script":"doc['user'].value ? 1 : 0",
"type" : "number",
"lang" : "js"
}
}
}
Any ideas ?
Thank a lot.
--