Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 61149 invoked from network); 29 May 2007 10:21:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 May 2007 10:21:45 -0000 Received: (qmail 80371 invoked by uid 500); 29 May 2007 10:21:41 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 80342 invoked by uid 500); 29 May 2007 10:21:41 -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 80327 invoked by uid 99); 29 May 2007 10:21:41 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 May 2007 03:21:41 -0700 X-ASF-Spam-Status: No, hits=2.1 required=10.0 tests=RCVD_IN_WHOIS_INVALID,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of adb@teamware.com designates 212.226.92.15 as permitted sender) Received: from [212.226.92.15] (HELO monkey.teamware.com) (212.226.92.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 May 2007 03:21:35 -0700 Received: from intrepid (intrepid.teamw.com [10.142.128.11]) by monkey.teamware.com (8.13.1/8.13.1) with ESMTP id l4TAL40h016305 for ; Tue, 29 May 2007 13:21:04 +0300 Received: from [10.142.130.117] ([10.142.130.117]) by nimitz with ESMTP id m5tdl68o; 29 May 2007 13:21:00 +0300 Message-ID: <465BFE56.6060601@teamware.com> Date: Tue, 29 May 2007 13:20:06 +0300 From: Antony Bowesman Organization: Teamware Group User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: Re: Does Lucene search over memory too? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.6 (monkey.teamware.com [212.226.92.15]); Tue, 29 May 2007 13:21:04 +0300 (EEST) X-TWG-MailScanner-Information: See www.mailscanner.info for information X-TWG-MailScanner: Found to be clean X-TWG-MailScanner-SpamCheck: not spam, SpamAssassin (score=0.001, required 5, autolearn=not spam, BAYES_50 0.00) X-MailScanner-From: adb@teamware.com X-Virus-Checked: Checked by ClamAV on apache.org Doron Cohen wrote: > Antony Bowesman wrote on 28/05/2007 22:48:41: > >> I read the new IndexWriter Javadoc and I'm unclear about this >> autocommit. In >> 2.1, I thought an IndexReader opened in an IndexSearcher does not "see" >> additions to an index made by an IndexWriter, i.e. maxDoc and >> numDocs remain >> constant, so the statement >> >> "When autoCommit is true then every flush is also a commit (IndexReader >> instances will see each flush as changes to the index). This is >> the default, to >> match the behavior before 2.2" >> >> makes me wonder if my assumptions are wrong. Can you clarify >> what it means by >> the IndexReader "seeing" changes to the index? > > Antony, your assumptions were (and still are) correct - once > an index reader is opened it is unaffected by changes to the > underlying index. Would it be clearer if the javadoc said: > "(An IndexReader instance will see changes to the index caused > by flush operations that completed prior to opening that > IndexReader instance)."? Thanks Doron, I understood "IndexReader instance" as one that was already open, as it's not possible to 'open' an existing object instance, the static open() methods create new instances. Your explanation clarifies things. So, the scenario where the IndexReader sees changes with autocommit=true is BEGIN IndexWriter - open - add documents - some merges/flushes occur here IndexReader - open - sees index with results of earlier merges IndexWriter - close END whereas with autocommit=false, the IndexReader would see the state of the index at BEGIN and any merges/flushes would not show. Perhaps the text could then be something like "(Changes to the index caused by flush operations will be visible to an IndexReader when it is opened prior to closing the IndexWriter)" It would also be worth updating the isCurrent() Javadoc to clarify its behaviour. Presumably, with autocommit=false, isCurrent() will always return true is only using the IndexWriter to add/delete documents. Antony --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org