Hi Karl, 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() { > int count = ramSegmentInfos.size(); > for (int i = 0; i < segmentInfos.size(); i++) { > SegmentInfo si = segmentInfos.info(i); > count += si.docCount; > } > return count; > } > > I don't understand, what is it this method returns? Number of > documents not flushed? Number of documents added with this writer in > total? Something else? "Something else" - it is the total number of documents in the index (counting in also docs that were already deleted). It is computed as sum of: 1) docs added to the index through this IndexWriter but not yet flushed: int count = ramSegmentInfos.size(); (notice that each of the writer's ram segments has exactly one document.) (2) counts of all the other (non-ram) segments. Do you see a problem in this method? Regards, Doron > > -- > karl --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]