Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 28556 invoked from network); 15 Sep 2008 18:49:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Sep 2008 18:49:13 -0000 Received: (qmail 93142 invoked by uid 500); 15 Sep 2008 18:49:05 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 92673 invoked by uid 500); 15 Sep 2008 18:49:03 -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 92657 invoked by uid 99); 15 Sep 2008 18:49:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Sep 2008 11:49:03 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [74.125.92.25] (HELO qw-out-2122.google.com) (74.125.92.25) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Sep 2008 18:48:04 +0000 Received: by qw-out-2122.google.com with SMTP id 5so182339qwi.53 for ; Mon, 15 Sep 2008 11:48:35 -0700 (PDT) Received: by 10.214.81.9 with SMTP id e9mr6278780qab.30.1221504514997; Mon, 15 Sep 2008 11:48:34 -0700 (PDT) Received: from ?10.17.4.4? ( [96.237.252.30]) by mx.google.com with ESMTPS id 6sm10480317qwk.1.2008.09.15.11.48.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 15 Sep 2008 11:48:34 -0700 (PDT) Message-Id: From: Michael McCandless To: java-user@lucene.apache.org In-Reply-To: <1bcb7c7f0809151049o1579b57cg8ace49a5ae4de51c@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v926) Subject: Re: IndexWriter commit Date: Mon, 15 Sep 2008 14:48:32 -0400 References: <1bcb7c7f0809151049o1579b57cg8ace49a5ae4de51c@mail.gmail.com> X-Mailer: Apple Mail (2.926) X-Virus-Checked: Checked by ClamAV on apache.org There is no difference, unless your computer/OS crashes or loses power shortly after you had call the method. In that case, there's a big difference: commit() guarantees your index will be intact (assuming the storage system holding your index was not damaged) but with flush(), which doesn't sync() the index files it writes, it's entirely possible that the index will become corrupt because some files were still in the OS's write cache when it crashed. But the guarantee only holds if the underlying storage system is "honest" about fsync(), ie, it truly flushes all written bytes for that file to disk before returning. Mike Cam Bazz wrote: > Hello, > > What is the difference between flush in <2.4 and commit? > > Also I have been looking over docs, and they mention commit(long) but > there is no commit(long) method but only commit() > > Best. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org