Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 89647 invoked from network); 11 Dec 2006 20:27:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Dec 2006 20:27:02 -0000 Received: (qmail 16334 invoked by uid 500); 11 Dec 2006 20:27:08 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 16285 invoked by uid 500); 11 Dec 2006 20:27:07 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 16274 invoked by uid 99); 11 Dec 2006 20:27:07 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Dec 2006 12:27:07 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of yseeley@gmail.com designates 66.249.92.168 as permitted sender) Received: from [66.249.92.168] (HELO ug-out-1314.google.com) (66.249.92.168) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Dec 2006 12:26:57 -0800 Received: by ug-out-1314.google.com with SMTP id k40so1554160ugc for ; Mon, 11 Dec 2006 12:26:36 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=VK4d3X8DUoSsAybNXwQI/AeE8NleWDkcwNFhDenZ4Lly6igvVl3yuXEYdXDUQibZ/TH6Vz0zEdKPnEvXJMlVrPEgGbTcIf/kM4zN1IVxsxPB34lsZViuJHfezQ1vHoxQ52yH5GvYFmLsYdX7clI6Rxi60r1WQwrcnor+MamrFdQ= Received: by 10.82.139.17 with SMTP id m17mr669306bud.1165868795841; Mon, 11 Dec 2006 12:26:35 -0800 (PST) Received: by 10.82.149.12 with HTTP; Mon, 11 Dec 2006 12:26:35 -0800 (PST) Message-ID: Date: Mon, 11 Dec 2006 15:26:35 -0500 From: "Yonik Seeley" Sender: yseeley@gmail.com To: java-dev@lucene.apache.org Subject: Re: Exposing IndexReader commit() In-Reply-To: <20061204223520.77683.qmail@web50306.mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20061204223520.77683.qmail@web50306.mail.yahoo.com> X-Google-Sender-Auth: 284df7b90fb7f25f X-Virus-Checked: Checked by ClamAV on apache.org Hi Otis, What is your real usecase here? Is it to make sure deletes are flushed in the event of a crash? Otherwise I don't see the problem with delaying deletes. -Yonik http://incubator.apache.org/solr Solr, the open-source Lucene search server On 12/4/06, Otis Gospodnetic wrote: > Hello, > > I'm wondering about opening up commit() in IndexReader. It's currently "protected". > > We'd like to be able to control the flushing of deletes to disk, and it looks like that's what IndexReader's commit() does. We tried extending SegmentReader with our own version that overrides commit() and let's us call it. This worked for indices with a single segment, because they are read by SegmentReader. However, this didn't work with multi-segment indices, because unlike SegmentReader, MultiReader doesn't know how to dynamically load a custom MultiReader. > Both SegmentReader and MultiReader extend IndexReader, which contains that protected commit(). > > Next, we thought we'd try extending IndexReader and using our own IndexReader, but since Segment|MultiReader extend IndexReader directly, I don't think this approach would work. > > In the end, we just made commit() public in IndexReader, and solved our problem for both single and multi-segment indices. > > Is there a better way to control flushing to disk without closing and re-opening an IndexReader, which is more expensive than just commit()ing. > If not, what do you think about making commit() public and javadocing it with "Expert:...."? > > Thanks, > Otis --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org