lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Carlson <carl...@bookandhammer.com>
Subject Re: Iterate the index by document
Date Sun, 06 Oct 2002 15:17:57 GMT
Here is a code snippet of how to do it.
Note: this will return deleted documents too.

             IndexReader ir = IndexReader.open(indexPath);
             int maxDocs = ir.maxDocs();
             //Object[]
             dates = new String[maxDocs];
             for (int i=0; i<maxDocs; i++) {
                 dates[i] = ir.document(i).get("pubDate");
             }

--Peter

On Sunday, October 6, 2002, at 12:05 AM, Maurits van Wijland wrote:

> Hi all,
>
> Is there anyway one can iterate through the index
> and retrieve all the documents?
>
> Thanks anyone...
>
> regards,
>
> maurits.


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


Mime
View raw message