+1

On Fri, Sep 14, 2012 at 4:06 PM, Uwe Schindler <u...@thetaphi.de> wrote:
> We should also throw UOE from getChildScorers? This was the issue I had with 
> that one, because we never called freq(). Getting ChildScoreres from BS1 is 
> also useless, as the information is unuseable.
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: u...@thetaphi.de
>
>
>> -----Original Message-----
>> From: mikemcc...@apache.org [mailto:mikemcc...@apache.org]
>> Sent: Friday, September 14, 2012 7:17 PM
>> To: comm...@lucene.apache.org
>> Subject: svn commit: r1384852 - in
>> /lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search:
>> BooleanQuery.java BooleanScorer.java
>>
>> Author: mikemccand
>> Date: Fri Sep 14 17:16:33 2012
>> New Revision: 1384852
>>
>> URL: http://svn.apache.org/viewvc?rev=1384852&view=rev
>> Log:
>> improve comments; throw UOE from BS.freq() since it's not a doc-at-a-time
>> scorer
>>
>> Modified:
>>
>> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/BooleanQue
>> ry.java
>>
>> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/BooleanSco
>> rer.java
>>
>> Modified:
>> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/BooleanQue
>> ry.java
>> URL:
>> http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apac
>> he/lucene/search/BooleanQuery.java?rev=1384852&r1=1384851&r2=1384852
>> &view=diff
>> ================================================================
>> ==============
>> ---
>> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/BooleanQue
>> ry.java (original)
>> +++
>> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/BooleanQue
>> ry.java Fri Sep 14 17:16:33 2012
>> @@ -332,7 +332,14 @@ public class BooleanQuery extends Query
>>            optional.add(subScorer);
>>          }
>>        }
>> -
>> +
>> +      // NOTE: we could also use BooleanScorer, if we knew
>> +      // this BooleanQuery was embedded in another
>> +      // BooleanQuery that was also using BooleanScorer (ie,
>> +      // BooleanScorer can nest).  But this is hard to
>> +      // detect and we never do so today... (ie, we only
>> +      // return BooleanScorer for topScorer):
>> +
>>        // Check if we can return a BooleanScorer
>>        if (!scoreDocsInOrder && topScorer && required.size() == 0) {
>>          return new BooleanScorer(this, disableCoord, minNrShouldMatch,
>> optional, prohibited, maxCoord);
>>
>> Modified:
>> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/BooleanSco
>> rer.java
>> URL:
>> http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apac
>> he/lucene/search/BooleanScorer.java?rev=1384852&r1=1384851&r2=1384852
>> &view=diff
>> ================================================================
>> ==============
>> ---
>> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/BooleanSco
>> rer.java (original)
>> +++
>> lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/BooleanSco
>> rer.java Fri Sep 14 17:16:33 2012
>> @@ -254,7 +254,12 @@ final class BooleanScorer extends Scorer
>>            // clauses
>>            //&& (current.bits & requiredMask) == requiredMask) {
>>
>> -          // TODO: can we remove this?
>> +          // NOTE: Lucene always passes max =
>> +          // Integer.MAX_VALUE today, because we never embed
>> +          // a BooleanScorer inside another (even though
>> +          // that should work)... but in theory an outside
>> +          // app could pass a different max so we must check
>> +          // it:
>>            if (current.doc >= max){
>>              tmp = current;
>>              current = current.next;
>> @@ -318,7 +323,7 @@ final class BooleanScorer extends Scorer
>>
>>    @Override
>>    public float freq() throws IOException {
>> -    return current.coord;
>> +    throw new UnsupportedOperationException();
>>    }
>>
>>    @Override
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
> For additional commands, e-mail: dev-h...@lucene.apache.org
>



-- 
lucidworks.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to