27 jan 2007 kl. 21.19 skrev Doron Cohen:
karl wettin <[EMAIL PROTECTED]> wrote on 27/01/2007 11:54:18:
/** Returns the number of documents currently in this index. */
public synchronized int docCount() {
I don't understand, what is it this method returns?
"Something else" - it is the total number of documents in the index
(counting in also docs that were already deleted).
Much clearer now, thanks.
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?
I ask because you write that it withinin parantheses.
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?
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();
?
--
karl
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]