lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Espina <>
Subject Javascript function queries: opinions!
Date Tue, 15 Nov 2011 01:50:00 GMT
I'm going to generate some controversy with this one.

I created a proof of concept to add javascript functions to Solr and use
them as function queries. The objective of all this is to provide an easy
way to extend the function queries and to simplify its syntax and
readability. I would appreciate your opinions, in particular, regarding the
possibility of creating a Jira ticket requesting this functionality (not
necessarily to add this POC, but to initiate a discussion)

About the POC:

It is a ValueSource that gets a script from the solrconfig:

  <valueSourceParser name="js"
  <str name="script"><![CDATA[
   function duplicate(doc){
   return doc.doubleVal("foo_pd")*2;

Where "doc" represents the current document
Then to use it you call something like:

*Regarding the performance*, I've tested it with the standard engine
(Rhino) and, of course, it completely sucks. But in a recent post that I
published I show that using Google's V8 you can get incredible performance
boost of javascript:

However, I tried my POC with V8 in the same way I tested DIH in the post
but I didn't succed. One of those horrible JNI errors that kills the JVM
arises and I could't track it. Probably its a bug with jav8 (the V8 wrapper
that I used)

Thank you

*Emmanuel Espina | Lucid Imagination  <>
*T 1 650 353 4057 ext. 152
E emmanuel.espina

View raw message