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/test/org/apache/lucene/search TestSimilarity.java TestPhraseQuery.java TestRemoteSearchable.java TestWildcard.java
Date Fri, 27 Aug 2004 21:59:31 GMT
dnaber      2004/08/27 14:59:31

  Modified:    src/test/org/apache/lucene/search TestSimilarity.java
                        TestPhraseQuery.java TestRemoteSearchable.java
                        TestWildcard.java
  Log:
  don't use the deprecated API for BooleanQuery.add()
  
  Revision  Changes    Path
  1.6       +3 -3      jakarta-lucene/src/test/org/apache/lucene/search/TestSimilarity.java
  
  Index: TestSimilarity.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestSimilarity.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestSimilarity.java	8 Aug 2004 19:36:59 -0000	1.5
  +++ TestSimilarity.java	27 Aug 2004 21:59:31 -0000	1.6
  @@ -80,8 +80,8 @@
          });
   
       BooleanQuery bq = new BooleanQuery();
  -    bq.add(new TermQuery(a), false, false);
  -    bq.add(new TermQuery(b), false, false);
  +    bq.add(new TermQuery(a), BooleanClause.Occur.SHOULD);
  +    bq.add(new TermQuery(b), BooleanClause.Occur.SHOULD);
       //System.out.println(bq.toString("field"));
       searcher.search
         (bq,
  
  
  
  1.7       +6 -6      jakarta-lucene/src/test/org/apache/lucene/search/TestPhraseQuery.java
  
  Index: TestPhraseQuery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestPhraseQuery.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestPhraseQuery.java	21 Apr 2004 15:23:29 -0000	1.6
  +++ TestPhraseQuery.java	27 Aug 2004 21:59:31 -0000	1.7
  @@ -204,8 +204,8 @@
       
       TermQuery termQuery = new TermQuery(new Term("contents","foobar"));
       BooleanQuery booleanQuery = new BooleanQuery();
  -    booleanQuery.add(termQuery, true, false);
  -    booleanQuery.add(phraseQuery, true, false);
  +    booleanQuery.add(termQuery, BooleanClause.Occur.MUST);
  +    booleanQuery.add(phraseQuery, BooleanClause.Occur.MUST);
       hits = searcher.search(booleanQuery);
       assertEquals(1, hits.length());
       
  @@ -240,14 +240,14 @@
       assertEquals(2, hits.length());
       
       booleanQuery = new BooleanQuery();
  -    booleanQuery.add(termQuery, true, false);
  -    booleanQuery.add(phraseQuery, true, false);
  +    booleanQuery.add(termQuery, BooleanClause.Occur.MUST);
  +    booleanQuery.add(phraseQuery, BooleanClause.Occur.MUST);
       hits = searcher.search(booleanQuery);
       assertEquals(2, hits.length());
       
       booleanQuery = new BooleanQuery();
  -    booleanQuery.add(phraseQuery, true, false);
  -    booleanQuery.add(termQuery, true, false);
  +    booleanQuery.add(phraseQuery, BooleanClause.Occur.MUST);
  +    booleanQuery.add(termQuery, BooleanClause.Occur.MUST);
       hits = searcher.search(booleanQuery);
       assertEquals(2, hits.length());
       
  
  
  
  1.8       +2 -2      jakarta-lucene/src/test/org/apache/lucene/search/TestRemoteSearchable.java
  
  Index: TestRemoteSearchable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestRemoteSearchable.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TestRemoteSearchable.java	29 Mar 2004 22:48:06 -0000	1.7
  +++ TestRemoteSearchable.java	27 Aug 2004 21:59:31 -0000	1.8
  @@ -82,7 +82,7 @@
   
     public void testBooleanQuery() throws Exception {
       BooleanQuery query = new BooleanQuery();
  -    query.add(new TermQuery(new Term("test", "test")), true, false);
  +    query.add(new TermQuery(new Term("test", "test")), BooleanClause.Occur.MUST);
       search(query);
     }
   
  
  
  
  1.8       +3 -3      jakarta-lucene/src/test/org/apache/lucene/search/TestWildcard.java
  
  Index: TestWildcard.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestWildcard.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TestWildcard.java	29 Mar 2004 22:48:06 -0000	1.7
  +++ TestWildcard.java	27 Aug 2004 21:59:31 -0000	1.8
  @@ -64,11 +64,11 @@
           Query query5 = new WildcardQuery(new Term("body", "m*tals"));
   
           BooleanQuery query6 = new BooleanQuery();
  -        query6.add(query5, false, false);
  +        query6.add(query5, BooleanClause.Occur.SHOULD);
   
           BooleanQuery query7 = new BooleanQuery();
  -        query7.add(query3, false, false);
  -        query7.add(query5, false, false);
  +        query7.add(query3, BooleanClause.Occur.SHOULD);
  +        query7.add(query5, BooleanClause.Occur.SHOULD);
   
   	// Queries do not automatically lower-case search terms:
           Query query8 = new WildcardQuery(new Term("body", "M*tal*"));
  
  
  

---------------------------------------------------------------------
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