LUCENE-3268: fixed TestScoredDocIDsUtils to use log-merge policy

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1142386 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shai Erera 2011-07-03 07:44:01 +00:00
parent 77f27238c8
commit e92db313d4
1 changed files with 7 additions and 5 deletions

View File

@ -135,7 +135,7 @@ public class TestScoredDocIDsUtils extends LuceneTestCase {
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));
}
@ -225,9 +225,11 @@ public class TestScoredDocIDsUtils extends LuceneTestCase {
}
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));
}