Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 50556 invoked from network); 9 Jul 2003 19:24:14 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 9 Jul 2003 19:24:14 -0000 Received: (qmail 1771 invoked by uid 97); 9 Jul 2003 19:26:44 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@nagoya.betaversion.org Received: (qmail 1764 invoked from network); 9 Jul 2003 19:26:44 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 9 Jul 2003 19:26:44 -0000 Received: (qmail 50209 invoked by uid 500); 9 Jul 2003 19:24:09 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 50198 invoked from network); 9 Jul 2003 19:24:09 -0000 Received: from web12704.mail.yahoo.com (216.136.173.241) by daedalus.apache.org with SMTP; 9 Jul 2003 19:24:09 -0000 Message-ID: <20030709192414.31168.qmail@web12704.mail.yahoo.com> Received: from [195.29.54.169] by web12704.mail.yahoo.com via HTTP; Wed, 09 Jul 2003 12:24:14 PDT Date: Wed, 9 Jul 2003 12:24:14 -0700 (PDT) From: Otis Gospodnetic Subject: Re: Iterating through all documents indexed To: lucene-user@jakarta.apache.org Cc: Peter Becker In-Reply-To: <3F0BB347.4060406@dstc.edu.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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 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