Merge remote-tracking branch 'origin/master'

This commit is contained in:
Noble Paul 2016-11-25 00:51:49 +05:30
commit e35500dc13
2 changed files with 8 additions and 3 deletions

View File

@ -141,7 +141,12 @@ public class TestIndexSorting extends LuceneTestCase {
Sort indexSort = new Sort(sortField,
new SortField("id", SortField.Type.INT));
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
codec.numCalls = 0;

View File

@ -156,7 +156,7 @@ public class MockRandomMergePolicy extends MergePolicy {
if (LuceneTestCase.VERBOSE) {
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) {
// renumber fields
// NOTE: currently this only "blocks" bulk merges just by
@ -165,7 +165,7 @@ public class MockRandomMergePolicy extends MergePolicy {
if (LuceneTestCase.VERBOSE) {
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 {
// otherwise, reader is unchanged
return reader;