Apache Lucene open-source search software
Merging r1059432 through r1059822 into realtime branch
Michael Busch029f74e9d378
diff --cc lucene/src/java/org/apache/lucene/index/LogMergePolicy.javaindex 2173aa34952,f0bbd79ba48..80230b14b2a--- a/lucene/src/java/org/apache/lucene/index/LogMergePolicy.java+++ b/lucene/src/java/org/apache/lucene/index/LogMergePolicy.java@@@ -324,11 -327,14 +327,14 @@@ public abstract class LogMergePolicy ex}return spec.merges.size() == 0 ? null : spec;}-+/** Returns the merges necessary to optimize the index.- * This merge policy defines "optimized" to mean only one- * segment in the index, where that segment has no- * deletions pending nor separate norms, and it is in+ * This merge policy defines "optimized" to mean only the+ * requested number of segments is left in the index, and+ * respects the {@link #maxMergeSizeForOptimize} setting.+ * By default, and assuming {@code maxNumSegments=1}, only+ * one segment will be left in the index, where that segment+ * has no deletions pending nor separate norms, and it is in* compound file format if the current useCompoundFile* setting is true. This method returns multiple merges* (mergeFactor at a time) so the {@link MergeScheduler}diff --cc lucene/src/test/org/apache/lucene/index/TestSizeBoundedOptimize.javaindex 41001d035ac,c1d768276e2..01bc4a8b7e2--- a/lucene/src/test/org/apache/lucene/index/TestSizeBoundedOptimize.java+++ b/lucene/src/test/org/apache/lucene/index/TestSizeBoundedOptimize.java@@@ -63,9 -63,9 +63,9 @@@ public class TestSizeBoundedOptimize exconf = newWriterConfig();LogByteSizeMergePolicy lmp = new LogByteSizeMergePolicy();- lmp.setMaxMergeMB((min + 1) / (1 << 20));+ lmp.setMaxMergeMBForOptimize((min + 1) / (1 << 20));conf.setMergePolicy(lmp);-+writer = new IndexWriter(dir, conf);writer.optimize();writer.close();