lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gol...@apache.org
Subject cvs commit: jakarta-lucene/src/java/org/apache/lucene/index IndexWriter.java
Date Sat, 25 Oct 2003 13:54:08 GMT
goller      2003/10/25 06:54:08

  Modified:    src/java/org/apache/lucene/index IndexWriter.java
  Log:
  use docCount from merger in mergeSegments
  
  Revision  Changes    Path
  1.20      +3 -3      jakarta-lucene/src/java/org/apache/lucene/index/IndexWriter.java
  
  Index: IndexWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/IndexWriter.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- IndexWriter.java	21 Oct 2003 17:59:16 -0000	1.19
  +++ IndexWriter.java	25 Oct 2003 13:54:08 -0000	1.20
  @@ -401,7 +401,6 @@
     private final void mergeSegments(int minSegment)
         throws IOException {
       String mergedName = newSegmentName();
  -    int mergedDocCount = 0;
       if (infoStream != null) infoStream.print("merging segments");
       SegmentMerger merger = 
           new SegmentMerger(directory, mergedName, useCompoundFile);
  @@ -416,13 +415,14 @@
         if ((reader.directory()==this.directory) || // if we own the directory
             (reader.directory()==this.ramDirectory))
   	segmentsToDelete.addElement(reader);	  // queue segment for deletion
  -      mergedDocCount += reader.numDocs();
       }
  +    
  +    int mergedDocCount = merger.merge();
  +    
       if (infoStream != null) {
         infoStream.println();
         infoStream.println(" into "+mergedName+" ("+mergedDocCount+" docs)");
       }
  -    merger.merge();
       
       segmentInfos.setSize(minSegment);		  // pop old infos & add new
       segmentInfos.addElement(new SegmentInfo(mergedName, mergedDocCount,
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message