lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r432580 - /lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
Date Fri, 18 Aug 2006 13:33:17 GMT
Author: yonik
Date: Fri Aug 18 06:33:16 2006
New Revision: 432580

URL: http://svn.apache.org/viewvc?rev=432580&view=rev
Log:
move singleDocSegmentsCount maintinence to mergeSegments

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java?rev=432580&r1=432579&r2=432580&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java Fri Aug 18 06:33:16
2006
@@ -711,12 +711,10 @@
         mergeDocs += si.docCount;
       }
 
-      if (mergeDocs >= targetMergeDocs)	{	  // found a merge to do
+      if (mergeDocs >= targetMergeDocs)	 	  // found a merge to do
         mergeSegments(minSegment+1);
-        singleDocSegmentsCount = 0;
-      } else {
+      else
         break;
-      }
 
       targetMergeDocs *= mergeFactor;		  // increase target size
     }
@@ -747,6 +745,11 @@
       if ((reader.directory() == this.directory) || // if we own the directory
           (reader.directory() == this.ramDirectory))
         segmentsToDelete.addElement(reader);   // queue segment for deletion
+    }
+
+    // update 1-doc segments counter accordin to range of merged segments
+    if (singleDocSegmentsCount>0) {
+      singleDocSegmentsCount = Math.min(singleDocSegmentsCount, segmentInfos.size()-end);
     }
 
     int mergedDocCount = merger.merge();



Mime
View raw message