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 TestMultiPhraseQuery.java
Date Wed, 10 Nov 2004 15:18:27 GMT
dnaber      2004/11/10 07:18:27

  Modified:    src/test/org/apache/lucene/search TestMultiPhraseQuery.java
  Log:
  test slop
  
  Revision  Changes    Path
  1.5       +10 -1     jakarta-lucene/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java
  
  Index: TestMultiPhraseQuery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestMultiPhraseQuery.java	10 Nov 2004 13:59:23 -0000	1.4
  +++ TestMultiPhraseQuery.java	10 Nov 2004 15:18:27 -0000	1.5
  @@ -53,6 +53,7 @@
           add("blueberry pizza", writer);
           add("blueberry chewing gum", writer);
           add("bluebird pizza", writer);
  +        add("bluebird foobar pizza", writer);
           add("piccadilly circus", writer);
           writer.optimize();
           writer.close();
  @@ -108,6 +109,11 @@
           assertEquals(2, result.length()); // blueberry pizza, bluebird pizza
           assertEquals("body:\"(blueberry bluebird) pizza\"", query3.toString());
   
  +        // test slop:
  +        query3.setSlop(1);
  +        result = searcher.search(query3);
  +        assertEquals(3, result.length()); // blueberry pizza, bluebird pizza, bluebird
foobar pizza
  +
           MultiPhraseQuery query4 = new MultiPhraseQuery();
           try {
             query4.add(new Term("field1", "foo"));
  @@ -116,6 +122,9 @@
           } catch(IllegalArgumentException e) {
             // okay, all terms must belong to the same field
           }
  +        
  +        searcher.close();
  +        indexStore.close();
   
       }
       
  
  
  

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