lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cheolgoo Kang" <>
Subject IndexModifier's docCount is inconsistent
Date Fri, 06 Apr 2007 14:40:52 GMT
When we use IndexModifier's docCount() method, it calls it's
underlying IndexReader's numDocs() or IndexWriter's docCount() method.
Here is the problem that IndexReader.numDocs() cares about deleted
documents, but IndexWriter.docCount() ignores it.

So, I've made some modifications in IndexWriter.docCount() and added
SegmentInfo.getDeletedDocCount() to read the number of deleted docs as
in IndexReader. It works great in my application but I'm not sure it's
a right way to handle this.

I found that there is no dependencies using docCount() method anywhere
in lucene trunk except several test cases. If it was a intended
behavior, it's okay but IndexWriter should have provided a method like

Any comments?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message