lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sh...@apache.org
Subject svn commit: r1142385 - /lucene/dev/branches/branch_3x/lucene/contrib/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java
Date Sun, 03 Jul 2011 07:42:36 GMT
Author: shaie
Date: Sun Jul  3 07:42:35 2011
New Revision: 1142385

URL: http://svn.apache.org/viewvc?rev=1142385&view=rev
Log:
LUCENE-3268: fixed TestScoredDocIDsUtils to use log-merge policy

Modified:
    lucene/dev/branches/branch_3x/lucene/contrib/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java

Modified: lucene/dev/branches/branch_3x/lucene/contrib/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/contrib/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java?rev=1142385&r1=1142384&r2=1142385&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/contrib/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/contrib/facet/src/test/org/apache/lucene/facet/util/TestScoredDocIDsUtils.java
Sun Jul  3 07:42:35 2011
@@ -133,7 +133,7 @@ public class TestScoredDocIDsUtils exten
         numIteratedDocs++;
         int docNum = it.getDocID();
         assertFalse(
-            "Deleted docs must not appear in the allDocsScoredDocIds set",
+            "Deleted docs must not appear in the allDocsScoredDocIds set: " + docNum,
             docFactory.markedDeleted(docNum));
       }
 
@@ -222,9 +222,11 @@ public class TestScoredDocIDsUtils exten
   }
 
   static IndexReader createReaderWithNDocs(Random random, int nDocs, DocumentFactory docFactory,
Directory dir) throws IOException {
-    // Create the index
-    RandomIndexWriter writer = new RandomIndexWriter(random, dir, newIndexWriterConfig(random,
TEST_VERSION_CURRENT, 
-        new MockAnalyzer(random, MockTokenizer.KEYWORD, false)));
+    // Create the index - force log-merge policy since we rely on docs order.
+    RandomIndexWriter writer = new RandomIndexWriter(random, dir,
+        newIndexWriterConfig(random, TEST_VERSION_CURRENT,
+            new MockAnalyzer(random, MockTokenizer.KEYWORD, false))
+            .setMergePolicy(newLogMergePolicy()));
     for (int docNum = 0; docNum < nDocs; docNum++) {
       writer.addDocument(docFactory.getDoc(docNum));
     }



Mime
View raw message