lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <DCutt...@grandcentral.com>
Subject RE: cleaned up legacy code in BooleanQuery
Date Wed, 10 Oct 2001 17:47:52 GMT
Looks like a good cleanup to me.

Doug

> -----Original Message-----
> From: Dmitry Serebrennikov [mailto:dmitrys@earthlink.net]
> Sent: Sunday, October 07, 2001 5:10 PM
> To: lucene-dev@jakarta.apache.org
> Subject: cleaned up legacy code in BooleanQuery
> 
> 
> The mask logic in the BooleanQuery.scorer is no longer needed 
> because it 
> has moved to the BooleanScorer.add.
> Besides, the 32-clause limitation may need to go in the future and it 
> would be simpler to fix it in one place.
> Here's the diff:
> 
> Index: java/org/apache/lucene/search/BooleanQuery.java
> ===================================================================
> RCS file: 
> /home/cvspublic/jakarta-lucene/src/java/org/apache/lucene/sear
> ch/BooleanQuery.java,v
> retrieving revision 1.1.1.1
> diff -B -r1.1.1.1 BooleanQuery.java
> 130d129
> <     int theMask = 1, thisMask;
> 132,143c131,136
> <       BooleanClause c = (BooleanClause)clauses.elementAt(i);
> <       if (c.required || c.prohibited) {
> <       thisMask = theMask;
> <       theMask = theMask << 1;
> <       } else
> <       thisMask = 0;
> <
> <       Scorer subScorer = c.query.scorer(reader);
> <       if (subScorer != null)
> <       result.add(subScorer, c.required, c.prohibited);
> <       else if (c.required)
> <       return null;
> ---
>  >         BooleanClause c = (BooleanClause)clauses.elementAt(i);
>  >         Scorer subScorer = c.query.scorer(reader);
>  >         if (subScorer != null)
>  >             result.add(subScorer, c.required, c.prohibited);
>  >         else if (c.required)
>  >               return null;
> 145,147d137
> <     if (theMask == 0)
> <       throw new IndexOutOfBoundsException
> <       ("More than 32 required/prohibited clauses in query.");
> 
> 

Mime
View raw message