lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Lee <wwl...@uiuc.edu>
Subject Iterate through all the document ids in the index?
Date Sat, 19 Feb 2005 18:10:43 GMT
This should be a very simple question.  But I can't seem to
find the right way to do so.  Anyway, 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.

Iterating through from 0 to numDocs would work, I assume, if
the index is optimized (?).  I don't know what would happen if
it's not though.

I also don't think a WildcardQuery would work, since doing a
"*" would give me all the terms and I'd blow over the maximum
term limit in the BooleanQuery.

I'm probably missing something, and I'm sure the experts here
can point me to the obvious.

Thanks,

Will

-- 
William (Will) Lee 
Email: wwlee1@uiuc.edu
Computer Science, University of Illinois at Urbana-Champaign

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