mirror of https://github.com/apache/lucene.git
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:
parent
77f27238c8
commit
e92db313d4
|
@ -127,7 +127,7 @@ public class TestScoredDocIDsUtils extends LuceneTestCase {
|
|||
IndexReader reader = createReaderWithNDocs(random, N_DOCS, docFactory, dir);
|
||||
try {
|
||||
int numErasedDocs = reader.numDeletedDocs();
|
||||
|
||||
|
||||
ScoredDocIDs allDocs = ScoredDocIdsUtils.createAllDocsScoredDocIDs(reader);
|
||||
ScoredDocIDsIterator it = allDocs.iterator();
|
||||
int numIteratedDocs = 0;
|
||||
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue