lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: Iterate through all the document ids in the index?
Date Mon, 21 Feb 2005 16:20:23 GMT
William Lee wrote:
> is there a simple and
> fast way to get a list of document IDs through the lucene index?  
> 
> I can use a loop to iterate from 0 to IndexReader.maxDoc and
> check whether an the document id is valid through
> IndexReader.document(i), but this would imply that I have to
> retrieve the documents fields.

Use IndexReader.isDeleted() to check if each id is valid.  This is quite 
fast.

Doug

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message