Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 46191 invoked from network); 12 Jul 2003 08:14:23 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 12 Jul 2003 08:14:23 -0000 Received: (qmail 15512 invoked by uid 97); 12 Jul 2003 08:17:04 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@nagoya.betaversion.org Received: (qmail 15505 invoked from network); 12 Jul 2003 08:17:03 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 12 Jul 2003 08:17:03 -0000 Received: (qmail 45895 invoked by uid 500); 12 Jul 2003 08:14:21 -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 45859 invoked from network); 12 Jul 2003 08:14:20 -0000 Received: from smtpzilla2.xs4all.nl (194.109.127.138) by daedalus.apache.org with SMTP; 12 Jul 2003 08:14:20 -0000 Received: from as800 (a80-127-237-57.dial.xs4all.nl [80.127.237.57]) by smtpzilla2.xs4all.nl (8.12.9/8.12.9) with ESMTP id h6C8EUNX021611; Sat, 12 Jul 2003 10:14:30 +0200 (CEST) Content-Type: text/plain; charset="iso-8859-1" From: Ype Kingma To: "Lucene Users List" , "Wilton, Reece" Subject: Re: Advice on updating an index? Date: Sat, 12 Jul 2003 10:18:42 -0700 User-Agent: KMail/1.4.3 References: <496A2C679221504D8B8AE4B10267E876017CC7DF@gb-sm-cala-xm11.corp.disney.com> In-Reply-To: <496A2C679221504D8B8AE4B10267E876017CC7DF@gb-sm-cala-xm11.corp.disney.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200307121018.42623.ykingma@xs4all.nl> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Reece, On Friday 11 July 2003 16:05, Wilton, Reece wrote: > Hi, > > I'm having a bit of trouble figuring out the logic for deleting > documents from an index. Any advice is appreciated! > 4) I created an index with an IndexWriter and then optimized it and > closed it. > For each document: > - I create a new IndexReader, delete the document and close the > IndexReader > - I create a new IndexWriter, add the document and close the IndexWrite= r > At the end I open the index with an IndexWriter and then optimize it an= d > close it. > > This works! But it is pretty slow (compared to the other three tests). > Is this the best way of doing this? AFAIK, yes. You can speed this up by using multiple documents, ie. use a document set. Also, you don't need to close the index writer before optimizing. One variation: you might leave the IndexReader open in case you need it for searching, but I wouldn't recommend that under Windows because there an open file cannot be deleted from a directory. Lucene deletes such files during later optimizations. Kind regards, Ype --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org