lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: Iterating through all documents indexed
Date Wed, 09 Jul 2003 19:24:14 GMT
Moved to lucene-user.
Peter, also see this:

http://jguru.com/faq/view.jsp?EID=703116
http://jguru.com/faq/view.jsp?EID=587213
http://jguru.com/faq/view.jsp?EID=1042002

Otis


--- Peter Becker <pbecker@dstc.edu.au> wrote:
> And another one...
> 
> It seems a reoccuring question but I can't figure out how to do a
> proper 
> update of an index. The problem I have is iterating through all 
> documents -- I can think of a few hacks for this but there seems to
> be 
> no way to just get an iterator/enumeration of all documents. This bit
> of 
> code seems to work:
> 
>             IndexReader reader =
> IndexReader.open(this.indexLocation);
>             for(int i = 0; i < reader.maxDoc(); i++) {
>                 Document doc = reader.document(i);
>                 if(doc != null) {
>                    // check if up-to-date, fix if required
>                 }
>             }
> 
> but I am a bit suspicious about what happens when I start deleting 
> documents from the index. Is this ok? Are there better ways?
> 
>   Peter
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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