0.19.10 - Can not get the lang-javascript working

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.

--

You didn't specify the plugin version, as a result the plugin was installed
as a site plugin. But it's easy to fix. Shut down the server, and run the
following command to remove site plugin installation first

sudo elasticsearch/bin/plugin -remove lang-javascript

and then install the plugin with correct version (currenlty 1.2.0)

sudo elasticsearch/bin/plugin -install 

elasticsearch/elasticsearch-lang-javascript/1.2.0

Start server and check the log, it should look like this:

[2012-11-09 17:32:16,458][INFO ][plugins ] [Wagner, Kurt]
loaded [lang-javascript], sites []

On Friday, November 9, 2012 5:25:03 AM UTC-5, Nicolas Lagoutte wrote:

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.

--

Ah ! Thank You Igor ! It works fine with the version.
I'm a bit confused though, the documentation about plugins herehttp://www.elasticsearch.org/guide/reference/modules/plugins.htmlstates that without a version the master branch would be used. Is there a
bug with that behaviour ?

Le vendredi 9 novembre 2012 22:34:14 UTC, Igor Motov a écrit :

You didn't specify the plugin version, as a result the plugin was
installed as a site plugin. But it's easy to fix. Shut down the server, and
run the following command to remove site plugin installation first

sudo elasticsearch/bin/plugin -remove lang-javascript

and then install the plugin with correct version (currenlty 1.2.0)

sudo elasticsearch/bin/plugin -install 

elasticsearch/elasticsearch-lang-javascript/1.2.0

Start server and check the log, it should look like this:

[2012-11-09 17:32:16,458][INFO ][plugins ] [Wagner, Kurt]
loaded [lang-javascript], sites []

On Friday, November 9, 2012 5:25:03 AM UTC-5, Nicolas Lagoutte wrote:

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.

--