Thanks
I guess I should have looked in the code before asking those silly questions
:-)
I wonder why there isn't a specific API for that though ...

On Jan 11, 2008 7:36 PM, Steven A Rowe <[EMAIL PROTECTED]> wrote:

> 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]
>
>


-- 
Regards,

Shai Erera

Reply via email to