lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r889570 - /lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/search/TestFuzzyQuery.java
Date Fri, 11 Dec 2009 11:05:19 GMT
Author: uschindler
Date: Fri Dec 11 11:05:19 2009
New Revision: 889570

URL: http://svn.apache.org/viewvc?rev=889570&view=rev
Log:
LUCENE-2123: Better test for the PQ overflow

Modified:
    lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/search/TestFuzzyQuery.java

Modified: lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/search/TestFuzzyQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/search/TestFuzzyQuery.java?rev=889570&r1=889569&r2=889570&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/search/TestFuzzyQuery.java
(original)
+++ lucene/java/branches/lucene_3_0/src/test/org/apache/lucene/search/TestFuzzyQuery.java
Fri Dec 11 11:05:19 2009
@@ -96,14 +96,15 @@
     int savedClauseCount = BooleanQuery.getMaxClauseCount();
     try {
       BooleanQuery.setMaxClauseCount(2);
-      // This query would normally return 3 documents, because 3 terms match:
-      query = new FuzzyQuery(new Term("field", "aaaab"), FuzzyQuery.defaultMinSimilarity,
3);   
+      // This query would normally return 3 documents, because 3 terms match (see above):
+      query = new FuzzyQuery(new Term("field", "bbbbb"), FuzzyQuery.defaultMinSimilarity,
0);   
       hits = searcher.search(query, null, 1000).scoreDocs;
       assertEquals("only 2 documents should match", 2, hits.length);
-      Set<String> possibleTerms = new HashSet<String>(Arrays.asList("aaaaa","aaaab"));
+      order = Arrays.asList("bbbbb","abbbb");
       for (int i = 0; i < hits.length; i++) {
         final String term = searcher.doc(hits[i].doc).get("field");
-        assertTrue("term '" + term + "' should not appear in results", possibleTerms.contains(term));
+        //System.out.println(hits[i].score);
+        assertEquals(order.get(i), term);
       }
     } finally {
       BooleanQuery.setMaxClauseCount(savedClauseCount);



Mime
View raw message