karl wettin <[EMAIL PROTECTED]> wrote on 27/01/2007 13:49:24:

> Deleted as in still available in the segment and noted in the delted
> file, but not optimized and IllegalArgumentException thrown in case
> of IndexReader.document(n)? At least I think that is the way a
> Directory works?

Yes.. so it is a sum on maxDoc() of all the segments of the index,
both (1) committed and (2) yet in memory.

> Does the consumers of this method really want to take the number of
> documents that is not accessible in account too, or is that just
> something that is done for optimization reasons?

Actually this public method is not used anywhere in Lucene, except
for tests, and I don't know if it was added for any specific need,
or just anticipating someone would like to query on this.

>
> > Do you see a problem in this method?
>
> Luckely only in the IndexWriter of my alternate RAM index. :)
>
>
> In essence, should I return
>    index.getDocumentsByNumber().size() -
>    index.getDeletedDocuments().size() +
>    unflushedDocuments.size();
> or
>    index.getDocumentsByNumber().size() +
>    unflushedDocuments.size();
> ?
>

I guess it is the 2nd one - without subtracting the number of deleted
docs. (but I don't know what is getDocumentsByNumber() - nothing like
this in the trunk, nor in current patch for 550.)

Doron


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

Reply via email to