Re: short-circuit OR operator in lucene/solr

2013-07-22 Thread Mikhail Khludnev
Short answer, no - it has zero sense. But after some thinking, it can make some sense, potentially. DisjunctionSumScorer holds child scorers semi-ordered in a binary heap. Hypothetically inequality can be enforced at that heap, but heap might not work anymore for such alignment. Hence, instead of

Re: short-circuit OR operator in lucene/solr

2013-07-22 Thread Yonik Seeley
function queries to the rescue! q={!func}def(query($a),query($b),query($c)) a=field1:value1 b=field2:value2 c=field3:value3 def or default function returns the value of the first argument that matches. It's named default because it's more commonly used like def(popularity,50) (return the value

Re: short-circuit OR operator in lucene/solr

2013-07-22 Thread Roman Chyla
Deepak, I think your goal is to gain something in speed, but most likely the function query will be slower than the query without score computation (the filter query) - this stems from the fact how the query is executed, but I may, of course, be wrong. Would you mind sharing measurements you

Re: short-circuit OR operator in lucene/solr

2013-07-22 Thread Erick Erickson
Sweet! On Mon, Jul 22, 2013 at 10:54 AM, Yonik Seeley yo...@lucidworks.com wrote: function queries to the rescue! q={!func}def(query($a),query($b),query($c)) a=field1:value1 b=field2:value2 c=field3:value3 def or default function returns the value of the first argument that matches.

short-circuit OR operator in lucene/solr

2013-07-21 Thread Deepak Konidena
I understand that lucene's AND (), OR (||) and NOT (!) operators are shorthands for REQUIRED, OPTIONAL and EXCLUDE respectively, which is why one can't treat them as boolean operators (adhering to boolean algebra). I have been trying to construct a simple OR expression, as follows q =