Switching from mvel to groovy with java methods

2014-12-10 Thread Dunaeth
Hi,

With ES 1.4, the default scripting language switched from mvel to groovy. 
We were using script fields in our queries like 
«String.format('%02d',doc.date.date.monthOfYear)», is there a way to 
achieve the same result using groovy ? ATM, we're experiencing security 
exceptions, method calls not allowed.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/d9afcc9a-f4a5-411f-9fd2-0c51f44a5f2a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Switching from mvel to groovy with java methods

2014-12-10 Thread joergpra...@gmail.com
Can you post the security exception?

Jörg

On Wed, Dec 10, 2014 at 11:02 AM, Dunaeth lomig.po...@gmail.com wrote:

 Hi,

 With ES 1.4, the default scripting language switched from mvel to groovy.
 We were using script fields in our queries like
 «String.format('%02d',doc.date.date.monthOfYear)», is there a way to
 achieve the same result using groovy ? ATM, we're experiencing security
 exceptions, method calls not allowed.

 --
 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+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/elasticsearch/d9afcc9a-f4a5-411f-9fd2-0c51f44a5f2a%40googlegroups.com
 https://groups.google.com/d/msgid/elasticsearch/d9afcc9a-f4a5-411f-9fd2-0c51f44a5f2a%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEGB4UoNOT8OKo2wC_ezgdgq9_-QMDL7Z5h3mWgq_BNgw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Switching from mvel to groovy with java methods

2014-12-10 Thread Dunaeth
)
  
 at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  
 at java.lang.Thread.run(Thread.java:745) 1 error ]]; 
 }{[-Li6K0zKQnW-QBA1Y7xblQ][log-2014-03][0]: 
 RemoteTransportException[[sql1][inet[/10.16.75.3:9300]][indices:data/read/search[phase/query]]];


Le mercredi 10 décembre 2014 11:06:37 UTC+1, Jörg Prante a écrit :

 Can you post the security exception?

 Jörg

 On Wed, Dec 10, 2014 at 11:02 AM, Dunaeth lomig...@gmail.com 
 javascript: wrote:

 Hi,

 With ES 1.4, the default scripting language switched from mvel to groovy. 
 We were using script fields in our queries like 
 «String.format('%02d',doc.date.date.monthOfYear)», is there a way to 
 achieve the same result using groovy ? ATM, we're experiencing security 
 exceptions, method calls not allowed.

 -- 
 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 elasticsearc...@googlegroups.com javascript:.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/elasticsearch/d9afcc9a-f4a5-411f-9fd2-0c51f44a5f2a%40googlegroups.com
  
 https://groups.google.com/d/msgid/elasticsearch/d9afcc9a-f4a5-411f-9fd2-0c51f44a5f2a%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/2f582608-8840-4602-a1f7-6248fbe2e1fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Switching from mvel to groovy with java methods

2014-12-10 Thread Dunaeth
)
  
 at 
 org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:559)
  
 at 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  
 at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  
 at java.lang.Thread.run(Thread.java:745) 1 error ]]; 
 }{[-Li6K0zKQnW-QBA1Y7xblQ][log-2014-03][0]: 
 RemoteTransportException[[sql1][inet[/10.16.75.3:9300]][indices:data/read/search[phase/query]]];


 Le mercredi 10 décembre 2014 11:06:37 UTC+1, Jörg Prante a écrit :

 Can you post the security exception?

 Jörg

 On Wed, Dec 10, 2014 at 11:02 AM, Dunaeth lomig...@gmail.com wrote:

 Hi,

 With ES 1.4, the default scripting language switched from mvel to 
 groovy. We were using script fields in our queries like 
 «String.format('%02d',doc.date.date.monthOfYear)», is there a way to 
 achieve the same result using groovy ? ATM, we're experiencing security 
 exceptions, method calls not allowed.

 -- 
 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 elasticsearc...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/elasticsearch/d9afcc9a-f4a5-411f-9fd2-0c51f44a5f2a%40googlegroups.com
  
 https://groups.google.com/d/msgid/elasticsearch/d9afcc9a-f4a5-411f-9fd2-0c51f44a5f2a%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/ce3d5233-d0cb-41a5-8797-92fa3275fb26%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Switching from mvel to groovy with java methods

2014-12-10 Thread joergpra...@gmail.com
)
 at 
 org.elasticsearch.search.SearchService.parseSource(SearchService.java:665)
 at 
 org.elasticsearch.search.SearchService.createContext(SearchService.java:537)
 at 
 org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:509)
 at 
 org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:264)
 at org.elasticsearch.search.action.SearchServiceTransportAction$5.call(
 SearchServiceTransportAction.java:231) at org.elasticsearch.search.
 action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:228)
 at org.elasticsearch.search.action.SearchServiceTransportAction$23.run(
 SearchServiceTransportAction.java:559) at java.util.concurrent.
 ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at java.lang.Thread.run(Thread.java:745) 1 error ]];
 }{[-Li6K0zKQnW-QBA1Y7xblQ][log-2014-03][0]: RemoteTransportException[[
 sql1][inet[/10.16.75.3:9300]][indices:data/read/search[phase/query]]];


 Le mercredi 10 décembre 2014 11:06:37 UTC+1, Jörg Prante a écrit :

 Can you post the security exception?

 Jörg

 On Wed, Dec 10, 2014 at 11:02 AM, Dunaeth lomig...@gmail.com wrote:

 Hi,

 With ES 1.4, the default scripting language switched from mvel to
 groovy. We were using script fields in our queries like
 «String.format('%02d',doc.date.date.monthOfYear)», is there a way to
 achieve the same result using groovy ? ATM, we're experiencing security
 exceptions, method calls not allowed.

 --
 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 elasticsearc...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/elasticsearch/d9afcc9a-f4a5-411f-9fd2-0c51f44a5f2a%
 40googlegroups.com
 https://groups.google.com/d/msgid/elasticsearch/d9afcc9a-f4a5-411f-9fd2-0c51f44a5f2a%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 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+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/elasticsearch/ce3d5233-d0cb-41a5-8797-92fa3275fb26%40googlegroups.com
 https://groups.google.com/d/msgid/elasticsearch/ce3d5233-d0cb-41a5-8797-92fa3275fb26%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHV%3D3%3DKUQPM2-KC0OJCvypedhuvZTFNzgHeQzRZjADgJw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Switching from mvel to groovy with java methods

2014-12-10 Thread Dunaeth
.
 aggregations.support.ValuesSourceParser.config(ValuesSourceParser.java:153)
  
 at org.elasticsearch.search.aggregations.bucket.terms.
 TermsParser.parse(TermsParser.java:57) at org.elasticsearch.search.
 aggregations.AggregatorParsers.parseAggregators(AggregatorParsers.java:130)
  
 at org.elasticsearch.search.aggregations.AggregatorParsers.
 parseAggregators(AggregatorParsers.java:120) at 
 org.elasticsearch.search.aggregations.AggregatorParsers.
 parseAggregators(AggregatorParsers.java:77) at 
 org.elasticsearch.search.aggregations.AggregationParseElement.parse(
 AggregationParseElement.java:60) at org.elasticsearch.search.
 SearchService.parseSource(SearchService.java:665) at 
 org.elasticsearch.search.SearchService.createContext(SearchService.java:537)
  
 at 
 org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:509)
  
 at 
 org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:264)
  
 at org.elasticsearch.search.action.SearchServiceTransportAction$5.call(
 SearchServiceTransportAction.java:231) at org.elasticsearch.search.
 action.SearchServiceTransportAction$5.call(
 SearchServiceTransportAction.java:228) at org.elasticsearch.search.
 action.SearchServiceTransportAction$23.run(
 SearchServiceTransportAction.java:559) at java.util.concurrent.
 ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  
 at java.lang.Thread.run(Thread.java:745) 1 error ]]; 
 }{[-Li6K0zKQnW-QBA1Y7xblQ][log-2014-03][0]: RemoteTransportException[[
 sql1][inet[/10.16.75.3:9300]][indices:data/read/search[phase/query]]];


 Le mercredi 10 décembre 2014 11:06:37 UTC+1, Jörg Prante a écrit :

 Can you post the security exception?

 Jörg

 On Wed, Dec 10, 2014 at 11:02 AM, Dunaeth lomig...@gmail.com wrote:

 Hi,

 With ES 1.4, the default scripting language switched from mvel to 
 groovy. We were using script fields in our queries like 
 «String.format('%02d',doc.date.date.monthOfYear)», is there a way to 
 achieve the same result using groovy ? ATM, we're experiencing security 
 exceptions, method calls not allowed.

 -- 
 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 elasticsearc...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/elasticsearch/d9afcc9a-f4a5-411f-9fd2-0c51f44a5f2a%
 40googlegroups.com 
 https://groups.google.com/d/msgid/elasticsearch/d9afcc9a-f4a5-411f-9fd2-0c51f44a5f2a%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 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 elasticsearc...@googlegroups.com javascript:.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/elasticsearch/ce3d5233-d0cb-41a5-8797-92fa3275fb26%40googlegroups.com
  
 https://groups.google.com/d/msgid/elasticsearch/ce3d5233-d0cb-41a5-8797-92fa3275fb26%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/e87161b5-dd84-4a38-8dfd-47bd765133be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Switching from mvel to groovy with java methods

2014-12-10 Thread Dunaeth
)
  
 at 
 org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:538)
  
 at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:286) 
 at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:259) 
 at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:245) 
 at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:203) 
 at org.elasticsearch.script.groovy.GroovyScriptEngineService.compile(
 GroovyScriptEngineService.java:119) at org.elasticsearch.script.
 ScriptService.getCompiledScript(ScriptService.java:353) at 
 org.elasticsearch.script.ScriptService.compile(ScriptService.java:339) 
 at org.elasticsearch.script.ScriptService.search(ScriptService.java:475) 
 at org.elasticsearch.search.aggregations.support.ValuesSourceParser.
 createScript(ValuesSourceParser.java:193) at org.elasticsearch.search.
 aggregations.support.ValuesSourceParser.config(ValuesSourceParser.java:153)
  
 at org.elasticsearch.search.aggregations.bucket.terms.
 TermsParser.parse(TermsParser.java:57) at org.elasticsearch.search.
 aggregations.AggregatorParsers.parseAggregators(AggregatorParsers.java:130)
  
 at org.elasticsearch.search.aggregations.AggregatorParsers.
 parseAggregators(AggregatorParsers.java:120) at 
 org.elasticsearch.search.aggregations.AggregatorParsers.
 parseAggregators(AggregatorParsers.java:77) at 
 org.elasticsearch.search.aggregations.AggregationParseElement.parse(
 AggregationParseElement.java:60) at org.elasticsearch.search.
 SearchService.parseSource(SearchService.java:665) at 
 org.elasticsearch.search.SearchService.createContext(SearchService.java:537)
  
 at 
 org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:509)
  
 at 
 org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:264)
  
 at org.elasticsearch.search.action.SearchServiceTransportAction$
 5.call(SearchServiceTransportAction.java:231) at 
 org.elasticsearch.search.action.SearchServiceTransportAction$5.call(
 SearchServiceTransportAction.java:228) at org.elasticsearch.search.
 action.SearchServiceTransportAction$23.run(
 SearchServiceTransportAction.java:559) at java.util.concurrent.
 ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  
 at java.lang.Thread.run(Thread.java:745) 1 error ]]; 
 }{[-Li6K0zKQnW-QBA1Y7xblQ][log-2014-03][0]: RemoteTransportException[[
 sql1][inet[/10.16.75.3:9300]][indices:data/read/search[phase/query]]];


 Le mercredi 10 décembre 2014 11:06:37 UTC+1, Jörg Prante a écrit :

 Can you post the security exception?

 Jörg

 On Wed, Dec 10, 2014 at 11:02 AM, Dunaeth lomig...@gmail.com wrote:

 Hi,

 With ES 1.4, the default scripting language switched from mvel to 
 groovy. We were using script fields in our queries like 
 «String.format('%02d',doc.date.date.monthOfYear)», is there a way to 
 achieve the same result using groovy ? ATM, we're experiencing security 
 exceptions, method calls not allowed.

 -- 
 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 elasticsearc...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/elasticsearch/d9afcc9a-f4a5-411f-9fd2-0c51f44a5f2a%
 40googlegroups.com 
 https://groups.google.com/d/msgid/elasticsearch/d9afcc9a-f4a5-411f-9fd2-0c51f44a5f2a%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 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 elasticsearc...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/elasticsearch/ce3d5233-d0cb-41a5-8797-92fa3275fb26%40googlegroups.com
  
 https://groups.google.com/d/msgid/elasticsearch/ce3d5233-d0cb-41a5-8797-92fa3275fb26%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/4772fb46-74cf-438d-ab2f-19c4eacdc995%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


MVEL to Groovy

2014-11-26 Thread Brad Jordan
I'm trying to upgrade from ES 1.1.1 to ES 1.4.0. I need to updated my .MVEL 
scripts to groovy so in my Java code I did this:

updateRequestBuilder.setScript(scriptValue, 
ScriptService.ScriptType.INLINE);
updateRequestBuilder.setScriptLang(groovy);

My unit tests are failing which makes me thing the script is no longer 
being applied. Am I doing this correctly? Any ideas on how best to debug if 
the script is being applied?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/eb602917-d3a5-49c1-bbac-57ceeebde742%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.