Hi Shai,

On 01/11/2008 at 7:42 AM, Shai Erera wrote:
> Will IndexReader.maxDocs() - IndexReader.numDocs() give the
> correct result? or this is just a heuristic?

I think your expression gives the correct result - the abstract 
IndexReader.numDocs() method is implemented in SegmentReader as:

  public int numDocs() {
    // Don't call ensureOpen() here (it could affect performance)
    int n = maxDoc();
    if (deletedDocs != null)
      n -= deletedDocs.count();
    return n;
  }

Steve

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to