Re: Duplicate function MVEL script

2014-08-28 Thread Alex S.V.
The problem with MVEL that you can't redefine defined function in a script instance. Script class instantiates once the query starts, and then it's executing it again and again. MVEL is bad for complex scripting. Yes, you could use groovy,and should :) I found a good way to use it with the next

Re: groovy for scripting

2014-08-26 Thread Alex S.V.
providing self-update: I found that I could create cross-request cache using next script (like a cross-request incrementer): POST /test/_search { query: {match_all:{}}, script_fields: { a: { script: import groovy.lang.Script;class A extends Script{static i=0;def

groovy for scripting

2014-08-20 Thread Alex S.V.
I'm playing around with groovy scripting. By checking groovy lang plugin source code I found next steps in code execution: 1. Code compilation into script class 2. Script initialization via static method newInstance() 3. Script execution via calling the code on each document with binding

LookupScript per shard modification (native scripting)

2014-08-04 Thread Alex S.V.
Hi, I'm trying LookupScript example here: https://github.com/imotov/elasticsearch-native-script-example/blob/master/src/main/java/org/elasticsearch/examples/nativescript/script/LookupScript.java The idea of my script is to pre-cache all child documents in LookupScript instance, but I want to

Re: Cosine Similarity ElasticSearch

2014-08-01 Thread Alex S.V.
Hi, I found some native script codings from Igor Motov here: https://github.com/imotov/elasticsearch-native-script-example/blob/master/src/main/java/org/elasticsearch/examples/nativescript/script/CosineSimilarityScoreScript.java and now playing with it Alex On Friday, August 1, 2014

3rd party scoring service

2014-07-31 Thread Alex S.V.
Hello, My idea is to use 3rd party scoring service (REST), and currently I'd like to use native scripts and play with NativeScriptFactory. The approach has many drawbacks. Here is my problem - assume we have two entities - products and product prices. I should filter by price. Price is a

Re: 3rd party scoring service

2014-07-31 Thread Alex S.V.
. -- Itamar Syn-Hershko http://code972.com | @synhershko https://twitter.com/synhershko Freelance Developer Consultant Author of RavenDB in Action http://manning.com/synhershko/ On Thu, Jul 31, 2014 at 1:50 PM, Alex S.V. alexs.v...@gmail.com javascript: wrote: Hello, My idea is to use 3rd

elasticsearch dynamic scripting vs static script - deployment

2014-07-11 Thread Alex S.V.
Hi, We've been also hacked on our staging server because of opened ports :) I find dynamic scripting flexible for applications, but static scripting causes bunch of problems: 1. I should deploy it in special directory at elasticsearch node? We are using capistrano for web-app deployment and