Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 72799 invoked from network); 21 Feb 2006 15:46:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Feb 2006 15:46:16 -0000 Received: (qmail 11310 invoked by uid 500); 21 Feb 2006 15:46:07 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 11228 invoked by uid 500); 21 Feb 2006 15:46:06 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 11017 invoked by uid 99); 21 Feb 2006 15:46:05 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Feb 2006 07:46:05 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of NYH@il.ibm.com designates 195.212.29.151 as permitted sender) Received: from [195.212.29.151] (HELO mtagate2.de.ibm.com) (195.212.29.151) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Feb 2006 07:46:04 -0800 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate2.de.ibm.com (8.12.10/8.12.10) with ESMTP id k1LFjhHm249924 for ; Tue, 21 Feb 2006 15:45:43 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.12.10/NCO/VERS6.8) with ESMTP id k1LFjq0f150894 for ; Tue, 21 Feb 2006 16:45:52 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11/8.13.3) with ESMTP id k1LFjgas003649 for ; Tue, 21 Feb 2006 16:45:42 +0100 Received: from d12mc102.megacenter.de.ibm.com (d12mc102.megacenter.de.ibm.com [9.149.167.114]) by d12av02.megacenter.de.ibm.com (8.12.11/8.12.11) with ESMTP id k1LFjgCX003643 for ; Tue, 21 Feb 2006 16:45:42 +0100 In-Reply-To: Subject: Re: Open an IndexWriter in parallel with an IndexReader on the same index. To: java-user@lucene.apache.org X-Mailer: Lotus Notes Release 7.0 August 18, 2005 Message-ID: From: "Nadav Har'El" Date: Tue, 21 Feb 2006 17:35:56 +0200 X-MIMETrack: Serialize by Router on D12MC102/12/M/IBM(Release 7.0HF90 | November 16, 2005) at 21/02/2006 17:45:52 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N "Yonik Seeley" wrote on 21/02/2006 05:13:52 PM: > On 2/21/06, Pierre Luc Dupont wrote: > > is it possible to open an IndexWriter and an IndexReader on the same > > index, at the same time, > > to do deleteTerm and addDocument? > > No, it's not possible. You should batch things: do all your > deletions, close the IndexReader, then open an IndexWriter and do all > the addDocument calls. For some applications, the seperation of indexWriter (which can add a document) and indexReader (which can delete a document) is very inconvenient. For example, consider a case where documents are often updated, and we often need to find and remove the old document and add the new version of the document. the "indexModifier" class nicely hides the complexity from us and allows both addition and deletion, but the documentation says its performance sucks (when used in the way I just outlined): imagine 1000 documents being modified, and now we start deleting and adding each one, one after another. It would have been nice if someone wrote something like indexModifier, but with a cache, similar to what Yonik suggested above: deletions will not be done immediately, but rather cached and later done in batches. Of course, batched deletions should not remember the term to delete, but rather the matching document numbers at the time of the deletion - because after the addition of the modified document if we search for the term again we'll find two documents. What about this idea? Does an implementation of something similar already exist? -- Nadav Har'El --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org