mirror of https://github.com/apache/lucene.git
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
e35500dc13
|
@ -141,7 +141,12 @@ public class TestIndexSorting extends LuceneTestCase {
|
||||||
Sort indexSort = new Sort(sortField,
|
Sort indexSort = new Sort(sortField,
|
||||||
new SortField("id", SortField.Type.INT));
|
new SortField("id", SortField.Type.INT));
|
||||||
iwc.setIndexSort(indexSort);
|
iwc.setIndexSort(indexSort);
|
||||||
iwc.setMergePolicy(newLogMergePolicy());
|
LogMergePolicy policy = newLogMergePolicy();
|
||||||
|
// make sure that merge factor is always > 2
|
||||||
|
if (policy.getMergeFactor() <= 2) {
|
||||||
|
policy.setMergeFactor(3);
|
||||||
|
}
|
||||||
|
iwc.setMergePolicy(policy);
|
||||||
|
|
||||||
// add already sorted documents
|
// add already sorted documents
|
||||||
codec.numCalls = 0;
|
codec.numCalls = 0;
|
||||||
|
|
|
@ -156,7 +156,7 @@ public class MockRandomMergePolicy extends MergePolicy {
|
||||||
if (LuceneTestCase.VERBOSE) {
|
if (LuceneTestCase.VERBOSE) {
|
||||||
System.out.println("NOTE: MockRandomMergePolicy now swaps in a SlowCodecReaderWrapper for merging reader=" + reader);
|
System.out.println("NOTE: MockRandomMergePolicy now swaps in a SlowCodecReaderWrapper for merging reader=" + reader);
|
||||||
}
|
}
|
||||||
return SlowCodecReaderWrapper.wrap(new FilterLeafReader(reader) {});
|
return SlowCodecReaderWrapper.wrap(new FilterLeafReader(new MergeReaderWrapper(reader)) {});
|
||||||
} else if (thingToDo == 1) {
|
} else if (thingToDo == 1) {
|
||||||
// renumber fields
|
// renumber fields
|
||||||
// NOTE: currently this only "blocks" bulk merges just by
|
// NOTE: currently this only "blocks" bulk merges just by
|
||||||
|
@ -165,7 +165,7 @@ public class MockRandomMergePolicy extends MergePolicy {
|
||||||
if (LuceneTestCase.VERBOSE) {
|
if (LuceneTestCase.VERBOSE) {
|
||||||
System.out.println("NOTE: MockRandomMergePolicy now swaps in a MismatchedLeafReader for merging reader=" + reader);
|
System.out.println("NOTE: MockRandomMergePolicy now swaps in a MismatchedLeafReader for merging reader=" + reader);
|
||||||
}
|
}
|
||||||
return SlowCodecReaderWrapper.wrap(new MismatchedLeafReader(reader, r));
|
return SlowCodecReaderWrapper.wrap(new MismatchedLeafReader(new MergeReaderWrapper(reader), r));
|
||||||
} else {
|
} else {
|
||||||
// otherwise, reader is unchanged
|
// otherwise, reader is unchanged
|
||||||
return reader;
|
return reader;
|
||||||
|
|
Loading…
Reference in New Issue