You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2014/08/22 03:20:41 UTC

svn commit: r1619642 - in /lucene/dev/trunk/lucene: CHANGES.txt core/src/java/org/apache/lucene/index/IndexWriter.java

Author: rmuir
Date: Fri Aug 22 01:20:41 2014
New Revision: 1619642

URL: http://svn.apache.org/r1619642
Log:
LUCENE-5672: Fix addIndexes to call maybeMerge

Modified:
    lucene/dev/trunk/lucene/CHANGES.txt
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java

Modified: lucene/dev/trunk/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/CHANGES.txt?rev=1619642&r1=1619641&r2=1619642&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/CHANGES.txt (original)
+++ lucene/dev/trunk/lucene/CHANGES.txt Fri Aug 22 01:20:41 2014
@@ -96,7 +96,6 @@ Other
   perform as well as other options.  (Robert Muir)
 
 ======================= Lucene 4.11.0 ======================
-(No Changes)
 
 New Features
 
@@ -106,6 +105,11 @@ New Features
 * LUCENE-5889: Add commit method to AnalyzingInfixSuggester, and allow just using .add
   to build up the suggester.  (Varun Thacker via Mike McCandless)
 
+Bug Fixes
+
+* LUCENE-5672: IndexWriter.addIndexes() calls maybeMerge(), to ensure the index stays
+  healthy. If you don't want merging use NoMergePolicy instead. (Robert Muir)
+
 ======================= Lucene 4.10.0 ======================
 
 New Features

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java?rev=1619642&r1=1619641&r2=1619642&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java Fri Aug 22 01:20:41 2014
@@ -2388,11 +2388,6 @@ public class IndexWriter implements Clos
    * free space required will be higher by the size of the
    * starting index (see {@link #forceMerge(int)} for details).
    *
-   * <p>
-   * <b>NOTE:</b> this method only copies the segments of the incoming indexes
-   * and does not merge them. Therefore deleted documents are not removed and
-   * the new segments are not merged with the existing ones.
-   *
    * <p>This requires this index not be among those to be added.
    *
    * <p>
@@ -2499,6 +2494,7 @@ public class IndexWriter implements Clos
         IOUtils.closeWhileHandlingException(locks);
       }
     }
+    maybeMerge();
   }
   
   /**
@@ -2654,6 +2650,7 @@ public class IndexWriter implements Clos
     } catch (OutOfMemoryError oom) {
       handleOOM(oom, "addIndexes(IndexReader...)");
     }
+    maybeMerge();
   }
 
   /** Copies the segment files as-is into the IndexWriter's directory. */