lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject cvs commit: jakarta-lucene/src/java/org/apache/lucene/search PhrasePrefixQuery.java PrefixQuery.java RangeQuery.java MultiTermQuery.java
Date Fri, 27 Aug 2004 20:20:47 GMT
dnaber      2004/08/27 13:20:47

  Modified:    src/java/org/apache/lucene/search PhrasePrefixQuery.java
                        PrefixQuery.java RangeQuery.java
                        MultiTermQuery.java
  Log:
  don't use the deprecated API for BooleanQuery.add()
  
  Revision  Changes    Path
  1.13      +1 -1      jakarta-lucene/src/java/org/apache/lucene/search/PhrasePrefixQuery.java
  
  Index: PhrasePrefixQuery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/PhrasePrefixQuery.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- PhrasePrefixQuery.java	29 Mar 2004 22:48:03 -0000	1.12
  +++ PhrasePrefixQuery.java	27 Aug 2004 20:20:47 -0000	1.13
  @@ -202,7 +202,7 @@
         Term[] terms = (Term[])termArrays.get(0);
         BooleanQuery boq = new BooleanQuery();
         for (int i=0; i<terms.length; i++) {
  -        boq.add(new TermQuery(terms[i]), false, false);
  +        boq.add(new TermQuery(terms[i]), BooleanClause.Occur.SHOULD);
         }
         boq.setBoost(getBoost());
         return boq.createWeight(searcher);
  
  
  
  1.10      +1 -1      jakarta-lucene/src/java/org/apache/lucene/search/PrefixQuery.java
  
  Index: PrefixQuery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/PrefixQuery.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- PrefixQuery.java	29 Mar 2004 22:48:03 -0000	1.9
  +++ PrefixQuery.java	27 Aug 2004 20:20:47 -0000	1.10
  @@ -47,7 +47,7 @@
               term.field() == prefixField) {
             TermQuery tq = new TermQuery(term);	  // found a match
             tq.setBoost(getBoost());                // set the boost
  -          query.add(tq, false, false);		  // add to query
  +          query.add(tq, BooleanClause.Occur.SHOULD);		  // add to query
             //System.out.println("added " + term);
           } else {
             break;
  
  
  
  1.13      +2 -2      jakarta-lucene/src/java/org/apache/lucene/search/RangeQuery.java
  
  Index: RangeQuery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/RangeQuery.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- RangeQuery.java	29 Mar 2004 22:48:03 -0000	1.12
  +++ RangeQuery.java	27 Aug 2004 20:20:47 -0000	1.13
  @@ -96,7 +96,7 @@
                           }
                           TermQuery tq = new TermQuery(term); // found a match
                           tq.setBoost(getBoost()); // set the boost
  -                        query.add(tq, false, false); // add to query
  +                        query.add(tq, BooleanClause.Occur.SHOULD); // add to query
                       }
                   }
                   else {
  
  
  
  1.12      +1 -1      jakarta-lucene/src/java/org/apache/lucene/search/MultiTermQuery.java
  
  Index: MultiTermQuery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/MultiTermQuery.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- MultiTermQuery.java	29 Mar 2004 22:48:03 -0000	1.11
  +++ MultiTermQuery.java	27 Aug 2004 20:20:47 -0000	1.12
  @@ -58,7 +58,7 @@
             if (t != null) {
               TermQuery tq = new TermQuery(t);      // found a match
               tq.setBoost(getBoost() * enumerator.difference()); // set the boost
  -            query.add(tq, false, false);          // add to query
  +            query.add(tq, BooleanClause.Occur.SHOULD);          // add to query
             }
           } while (enumerator.next());
         } finally {
  
  
  

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


Mime
View raw message