Fix test failure

This commit is contained in:
Adrien Grand 2024-07-19 15:18:08 +02:00
parent 9f991ed07e
commit cc3b412183
1 changed files with 3 additions and 1 deletions

View File

@ -154,7 +154,9 @@ public class TestIndexSorting extends LuceneTestCase {
Sort indexSort = new Sort(sortField, new SortField("id", SortField.Type.INT));
iwc.setIndexSort(indexSort);
LogMergePolicy policy = newLogMergePolicy();
// make sure that merge factor is always > 2
// make sure that merge factor is always > 2 and target search concurrency is no more than 1 to
// avoid creating merges that are accidentally sorted
policy.setTargetSearchConcurrency(1);
if (policy.getMergeFactor() <= 2) {
policy.setMergeFactor(3);
}