From lucene-dev-return-3788-qmlist-jakarta-archive-lucene-dev=nagoya.apache.org@jakarta.apache.org Wed Jul 09 06:16:34 2003 Return-Path: Delivered-To: apmail-jakarta-lucene-dev-archive@apache.org Received: (qmail 81253 invoked from network); 9 Jul 2003 06:16:33 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 9 Jul 2003 06:16:33 -0000 Received: (qmail 7320 invoked by uid 97); 9 Jul 2003 06:19:10 -0000 Delivered-To: qmlist-jakarta-archive-lucene-dev@nagoya.betaversion.org Received: (qmail 7313 invoked from network); 9 Jul 2003 06:19:10 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 9 Jul 2003 06:19:10 -0000 Received: (qmail 80973 invoked by uid 500); 9 Jul 2003 06:16:31 -0000 Mailing-List: contact lucene-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Developers List" Reply-To: "Lucene Developers List" Delivered-To: mailing list lucene-dev@jakarta.apache.org Received: (qmail 80960 invoked from network); 9 Jul 2003 06:16:30 -0000 Received: from natsmtp01.webmailer.de (HELO post.webmailer.de) (192.67.198.81) by daedalus.apache.org with SMTP; 9 Jul 2003 06:16:30 -0000 Received: from dstc.edu.au (g613-8949.itee.uq.edu.au [130.102.66.107]) by post.webmailer.de (8.12.8/8.8.7) with ESMTP id h696GeFO023738 for ; Wed, 9 Jul 2003 08:16:41 +0200 (MEST) Message-ID: <3F0BB347.4060406@dstc.edu.au> Date: Wed, 09 Jul 2003 16:16:39 +1000 From: Peter Becker User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Lucene Developers List Subject: Iterating through all documents indexed Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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