Return-Path: X-Original-To: apmail-lucene-general-archive@www.apache.org Delivered-To: apmail-lucene-general-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 12C3610FD5 for ; Wed, 5 Jun 2013 11:45:46 +0000 (UTC) Received: (qmail 76657 invoked by uid 500); 5 Jun 2013 11:45:45 -0000 Delivered-To: apmail-lucene-general-archive@lucene.apache.org Received: (qmail 76474 invoked by uid 500); 5 Jun 2013 11:45:45 -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 76462 invoked by uid 99); 5 Jun 2013 11:45:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jun 2013 11:45:44 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: local policy) Received: from [209.85.220.170] (HELO mail-vc0-f170.google.com) (209.85.220.170) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jun 2013 11:45:40 +0000 Received: by mail-vc0-f170.google.com with SMTP id hf12so1044767vcb.15 for ; Wed, 05 Jun 2013 04:44:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:x-gm-message-state; bh=JM52iDSXOiTC9gDMfydQg9KOtqVd9rLUSE3dnanoJnk=; b=WY4nz0Vp3cIbeYI3XWa7Oojd2z80Q8PJ4gKywANd5hQtnUE2qIvSsabvY9ELX1If8O 6oXOSWZsPDp12UTlJhJN6iDs/ssCcnmXOfGb4MCpBDOEb3g3eTRqOdR56Q3OoFOeyjgq SUmB4zCTkVWg5VekoceqVEBs6C+/T5HWMTDFTZCg28HgVAIeLBATPcKDFiHPq+q6Eeqd tjihrwDCrkiyRQBrCt6caEXWYz6whPiUcHLn6S1S70r0Wp4qvYMB1Qp3DSsSHrRteOSD OImKMIPTtgYFbOihprpae3J12fGAA5DpCnYoMoq33YSuXdB4HeaYylJAEMl+WtKlx4ib u3nw== X-Received: by 10.220.248.137 with SMTP id mg9mr20254196vcb.38.1370432698846; Wed, 05 Jun 2013 04:44:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.119.206 with HTTP; Wed, 5 Jun 2013 04:44:38 -0700 (PDT) In-Reply-To: References: From: Michael McCandless Date: Wed, 5 Jun 2013 07:44:38 -0400 Message-ID: Subject: Re: IndexWriter.commit() performance To: "general@lucene.apache.org" Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQlZ3ea5rPwB3GnuHBno0tb/9jDuXKBU3NKetFKJj8Jg/NP6v0Mx62Md/zYf+RGOtwd1IocY X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Jun 4, 2013 at 7:31 PM, Renata Vaccaro wrote: > Thanks. I need the documents to be searchable as soon as they are > added. I also need the documents added to survive a machine crash. > > Soft commits and NRT gets might work, but from what I've read they are > only available for Solr? Likely commits got slower on upgrade because on your very, very old Lucene version fsync was not called, so there was no safety on OS/hardware crash to ensure the index was intact. Solr's soft commit uses Lucene's near-real-time APIs, so you can definitely do this with just Lucene: pass the IndexWriter to DirectoryReader.open, and then use DirectoryReader.openIfChanged to reopen (without committing). This lets you decouple durability to crashes (how often you commit) from index-to-search latency (how often you reopen the reader). Mike McCandless http://blog.mikemccandless.com