Unable to get script_fields to work

Hopefully someone can point me in the right direction on this: I am having
trouble getting the simple script_fields example
at http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-scripting.html
to work

here is the info:

  1. installed ES 1.4.3 on an ubuntu box in a three node cluster; cluster is
    healthy/green
  2. created a test index and type and added about a million docs to it; my
    searches/etc work fine
  3. created file /etc/elasticsearch/scripts/test.groovy and added this very
    simple script line (and nothing else) to it: 1 + my_var
  4. believe I have made the test.groovy file accessible to elasticsearch
    (made the file owner "elasticsearch" and set access to 666 (rw-rw-rw-)
  5. added this line to my /etc/elasticsearch/elasticsearch.yml file to
    enable dynamic scripting (tho thought this wasn't needed for disk based
    scripts): script.disable_dynamic: false
  6. tried running this query in marvel sense but just get an error (shown at
    bottom of this post):
    GET test/_search
    {
    "script_fields" : {
    "my_field" : {
    "params" : {
    "my_var": 10
    },
    "script_file":"test"
    }
    }
    }
  7. this dynamic inline query runs fine with no error:
    GET moveapi/_search
    {
    "script_fields": {
    "my_field": {
    "script": "1 + my_var",
    "params": {
    "my_var": 2
    }
    }
    }
    }

I have tried many variations of the disk based script without success. Can
anyone provide some advice re how to get this to work? I must be missing
some setting or something.

Any help REALLY appreciated. thanks in advance


the error message I get (with "\n" replace with cr/lf to make it readable):

{
"error": "SearchPhaseExecutionException[Failed to execute phase [query],
all shards failed; shardFailures {[ZkHUmZijTsuQbc8Q7dvpmg][moveapi][0]:
RemoteTransportException[[homer][inet[/172.31.48.158:9300]][indices:data/read/search[phase/query]]];
nested: SearchParseException[[moveapi][0]: from[-1],size[-1]: Parse Failure
[Failed to parse source [{
"script_fields" : {
"my_field" : {
"params" : {
"my_var": 10
},
"script_file":"test"
}
}
}
]]]; nested: NullPointerException; }{[HW4kOpXXShCA3uCNasmrKA][moveapi][1]:
SearchParseException[[moveapi][1]: from[-1],size[-1]: Parse Failure [Failed
to parse source [{
"script_fields" : {
"my_field" : {
"params" : {
"my_var": 10
},
"script_file":"test"
}
}
}
]]]; nested: NullPointerException; }{[HW4kOpXXShCA3uCNasmrKA][moveapi][2]:
SearchParseException[[moveapi][2]: from[-1],size[-1]: Parse Failure [Failed
to parse source [{
"script_fields" : {
"my_field" : {
"params" : {
"my_var": 10
},
"script_file":"test"
}
}
}
]]]; nested: NullPointerException; }{[8GqmuI3wRtKCJQ6mDK_6YA][moveapi][3]:
RemoteTransportException[[marge][inet[/172.31.48.157:9300]][indices:data/read/search[phase/query]]];
nested: SearchParseException[[moveapi][3]: from[-1],size[-1]: Parse Failure
[Failed to parse source [{
"script_fields" : {
"my_field" : {
"params" : {
"my_var": 10
},
"script_file":"test"
}
}
}
]]]; nested: NullPointerException; }{[ZkHUmZijTsuQbc8Q7dvpmg][moveapi][4]:
RemoteTransportException[[homer][inet[/172.31.48.158:9300]][indices:data/read/search[phase/query]]];
nested: SearchParseException[[moveapi][4]: from[-1],size[-1]: Parse Failure
[Failed to parse source [{
"script_fields" : {
"my_field" : {
"params" : {
"my_var": 10
},
"script_file":"test"
}
}
}
]]]; nested: NullPointerException; }]",
"status": 400
}

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/35b61bc6-1f7a-4f2c-bd2d-38a8a34d9cf3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

fyi:

my config files (elasticsearch.yml and logging.yml) are
in /etc/elasticsearch. the script_fields documentation indicated that I
put the test.groovy in "config/scripts" folder, so I assumed my location is
correct as I am unable to find a "config" folder in any elasticsearch folder

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/af424481-4902-4d63-972d-7565c9c133fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I'm having the same problem. Were you able to resolve this? Thanks!

On Thursday, February 26, 2015 at 10:38:26 AM UTC-8, Gerald DeConto wrote:

fyi:

my config files (elasticsearch.yml and logging.yml) are
in /etc/elasticsearch. the script_fields documentation indicated that I
put the test.groovy in "config/scripts" folder, so I assumed my location is
correct as I am unable to find a "config" folder in any elasticsearch folder

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/1b71e8f1-7cb7-41d2-8587-b6a5f88e5ebb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Unfortunately no. Had to move on and skip scripts

On 1:27pm, Mar 31, 2015, at 1:27pm, Julia Neidert neid0021@gmail.com wrote:

I'm having the same problem. Were you able to resolve this? Thanks!

On Thursday, February 26, 2015 at 10:38:26 AM UTC-8, Gerald DeConto
wrote:

fyi:

my config files (elasticsearch.yml and logging.yml) are
in /etc/elasticsearch. the script_fields documentation indicated
that I
put the test.groovy in "config/scripts" folder, so I assumed my
location is
correct as I am unable to find a "config" folder in any elasticsearch
folder

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/4GOnbUeWw6c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/1b71e8f1-7cb7-41d2-8587-b6a5f88e5ebb%40googlegroups.com.
For more options, visit 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/649a33fd-1f7d-40ba-98d0-2236514f9a47%40email.typeapp.com.
For more options, visit https://groups.google.com/d/optout.

I had the same problem, but I think that the docs are plain wrong, and it
should be script instead of script_file. In any case, if I do that it works
fine.

I've posted an issue under

Test program and session:

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/8d826037-1247-4c9d-b566-aaa59cf090fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Will try that when I get a chance.thx

On 4:52am, Apr 5, 2015, at 4:52am, Wouter van Atteveldt vanatteveldt@gmail.com wrote:

I had the same problem, but I think that the docs are plain wrong, and
it
should be script instead of script_file. In any case, if I do that it
works
fine.

I've posted an issue under
https://github.com/elastic/elasticsearch/issues/10438

Test program and session:
https://gist.github.com/vanatteveldt/59ff5730b025270e8035

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/4GOnbUeWw6c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/8d826037-1247-4c9d-b566-aaa59cf090fe%40googlegroups.com.
For more options, visit 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/0cd6d3ca-0b54-4665-85c0-0cfcddf3e919%40email.typeapp.com.
For more options, visit https://groups.google.com/d/optout.