lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1044505 - in /lucene/dev/trunk/lucene/src: java/org/apache/lucene/index/IndexWriter.java test/org/apache/lucene/index/TestNRTThreads.java
Date Fri, 10 Dec 2010 20:55:19 GMT
Author: mikemccand
Date: Fri Dec 10 20:55:19 2010
New Revision: 1044505

URL: http://svn.apache.org/viewvc?rev=1044505&view=rev
Log:
LUCENE-2809: use del count from reader if it's pooled, in IW.numDocs

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

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/IndexWriter.java?rev=1044505&r1=1044504&r2=1044505&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/IndexWriter.java Fri Dec 10 20:55:19
2010
@@ -1219,7 +1219,7 @@ public class IndexWriter implements Clos
 
     for (int i = 0; i < segmentInfos.size(); i++) {
       final SegmentInfo info = segmentInfos.info(i);
-      count += info.docCount - info.getDelCount();
+      count += info.docCount - numDeletedDocs(info);
     }
     return count;
   }

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestNRTThreads.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestNRTThreads.java?rev=1044505&r1=1044504&r2=1044505&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestNRTThreads.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestNRTThreads.java Fri Dec 10
20:55:19 2010
@@ -316,7 +316,7 @@ public class TestNRTThreads extends Luce
       System.out.println("TEST: done join [" + (System.currentTimeMillis()-t0) + " ms]; addCount="
+ addCount + " delCount=" + delCount);
     }
     writer.commit();
-    assertEquals(addCount.get() - delCount.get(), writer.numDocs());
+    assertEquals("index=" + writer.segString(), addCount.get() - delCount.get(), writer.numDocs());
       
     writer.close(false);
     dir.close();



Mime
View raw message