mirror of https://github.com/apache/lucene.git
LUCENE-2809: use del count from reader if it's pooled, in IW.numDocs
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1044505 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ab3b6ced80
commit
cf12c2d1d3
|
@ -1219,7 +1219,7 @@ public class IndexWriter implements Closeable {
|
||||||
|
|
||||||
for (int i = 0; i < segmentInfos.size(); i++) {
|
for (int i = 0; i < segmentInfos.size(); i++) {
|
||||||
final SegmentInfo info = segmentInfos.info(i);
|
final SegmentInfo info = segmentInfos.info(i);
|
||||||
count += info.docCount - info.getDelCount();
|
count += info.docCount - numDeletedDocs(info);
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
|
@ -316,7 +316,7 @@ public class TestNRTThreads extends LuceneTestCase {
|
||||||
System.out.println("TEST: done join [" + (System.currentTimeMillis()-t0) + " ms]; addCount=" + addCount + " delCount=" + delCount);
|
System.out.println("TEST: done join [" + (System.currentTimeMillis()-t0) + " ms]; addCount=" + addCount + " delCount=" + delCount);
|
||||||
}
|
}
|
||||||
writer.commit();
|
writer.commit();
|
||||||
assertEquals(addCount.get() - delCount.get(), writer.numDocs());
|
assertEquals("index=" + writer.segString(), addCount.get() - delCount.get(), writer.numDocs());
|
||||||
|
|
||||||
writer.close(false);
|
writer.close(false);
|
||||||
dir.close();
|
dir.close();
|
||||||
|
|
Loading…
Reference in New Issue