lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1177055 - in /lucene/dev/branches/branch_3x: ./ lucene/ lucene/backwards/src/test/ lucene/src/test/org/apache/lucene/search/TestQueryWrapperFilter.java solr/
Date Wed, 28 Sep 2011 20:42:35 GMT
Author: rmuir
Date: Wed Sep 28 20:42:34 2011
New Revision: 1177055

URL: http://svn.apache.org/viewvc?rev=1177055&view=rev
Log:
backport additional test

Modified:
    lucene/dev/branches/branch_3x/   (props changed)
    lucene/dev/branches/branch_3x/lucene/   (props changed)
    lucene/dev/branches/branch_3x/lucene/backwards/src/test/   (props changed)
    lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestQueryWrapperFilter.java
    lucene/dev/branches/branch_3x/solr/   (props changed)

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestQueryWrapperFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestQueryWrapperFilter.java?rev=1177055&r1=1177054&r2=1177055&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestQueryWrapperFilter.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestQueryWrapperFilter.java
Wed Sep 28 20:42:34 2011
@@ -28,6 +28,7 @@ import org.apache.lucene.index.RandomInd
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.BooleanClause.Occur;
 import org.apache.lucene.store.Directory;
+import org.apache.lucene.util.English;
 import org.apache.lucene.util.LuceneTestCase;
 
 public class TestQueryWrapperFilter extends LuceneTestCase {
@@ -158,4 +159,30 @@ public class TestQueryWrapperFilter exte
     r.close();
     d.close();
   }
+  
+  public void testThousandDocuments() throws Exception {
+    Directory dir = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random, dir);
+    for (int i = 0; i < 1000; i++) {
+      Document doc = new Document();
+      doc.add(newField("field", English.intToEnglish(i), Field.Index.NOT_ANALYZED));
+      writer.addDocument(doc);
+    }
+    
+    IndexReader reader = writer.getReader();
+    writer.close();
+    
+    IndexSearcher searcher = newSearcher(reader);
+    
+    for (int i = 0; i < 1000; i++) {
+      TermQuery termQuery = new TermQuery(new Term("field", English.intToEnglish(i)));
+      QueryWrapperFilter qwf = new QueryWrapperFilter(termQuery);
+      TopDocs td = searcher.search(new MatchAllDocsQuery(), qwf, 10);
+      assertEquals(1, td.totalHits);
+    }
+    
+    searcher.close();
+    reader.close();
+    dir.close();
+  }
 }



Mime
View raw message