Return-Path: Delivered-To: apmail-lucene-general-archive@www.apache.org Received: (qmail 7181 invoked from network); 9 Aug 2005 16:58:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Aug 2005 16:58:15 -0000 Received: (qmail 95363 invoked by uid 500); 9 Aug 2005 16:58:15 -0000 Delivered-To: apmail-lucene-general-archive@lucene.apache.org Received: (qmail 95344 invoked by uid 500); 9 Aug 2005 16:58:14 -0000 Mailing-List: contact general-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: general@lucene.apache.org Delivered-To: mailing list general@lucene.apache.org Received: (qmail 95331 invoked by uid 99); 9 Aug 2005 16:58:14 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Aug 2005 09:58:14 -0700 X-ASF-Spam-Status: No, hits=1.8 required=10.0 tests=RCVD_IN_NJABL_DUL,RCVD_IN_SORBS_DUL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [207.115.57.60] (HELO ylpvm29.prodigy.net) (207.115.57.60) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Aug 2005 09:58:36 -0700 Received: from pimout3-ext.prodigy.net (pimout3-int.prodigy.net [207.115.4.218]) by ylpvm29.prodigy.net (8.12.10 outbound/8.12.10) with ESMTP id j79GwA4w002955 for ; Tue, 9 Aug 2005 12:58:10 -0400 X-ORBL: [63.205.70.111] Received: from [192.168.168.81] (adsl-63-205-70-111.dsl.snfc21.pacbell.net [63.205.70.111]) by pimout3-ext.prodigy.net (8.13.4 outbound domainkey aix/8.13.4) with ESMTP id j79GvvMh194564; Tue, 9 Aug 2005 12:58:02 -0400 Message-ID: <42F8E095.7030806@apache.org> Date: Tue, 09 Aug 2005 09:57:57 -0700 From: Doug Cutting User-Agent: Mozilla Thunderbird 1.0.6-1.1.fc3 (X11/20050720) X-Accept-Language: en-us, en MIME-Version: 1.0 To: general@lucene.apache.org Subject: Re: IndexWriter and IndexReader open at the same time References: <50a1290508081614182cafe@mail.gmail.com> <20050809012404.92921.qmail@web31104.mail.mud.yahoo.com> <50a129050808202373e58539@mail.gmail.com> In-Reply-To: <50a129050808202373e58539@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Greg Love wrote: > In the TheServerSide case study of the book, page 375, they say that > they close the IndexWriter and even point out that they did before > openning the IndexReader and deleting. So that kinda makes me wonder > if i'm safe having an IndexReader with deletions and and IndexWriter > with inserts open at the same time (even though my code never does an > index modifying operation at the same time because they share a lock > in the my code). You should close the IndexReader you are using for deletions before opening the IndexWriter you use for additions. For higher throughput, queue additions and deletions and process them periodically as batches. If you're concerned about an addition followed by a deletion of the same document getting reversed in the queues, then simply check the addition queue each time you queue a deletion, and remove any matching additions. Doug