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 34DD310BBF for ; Tue, 4 Jun 2013 23:08:26 +0000 (UTC) Received: (qmail 26529 invoked by uid 500); 4 Jun 2013 23:08:25 -0000 Delivered-To: apmail-lucene-general-archive@lucene.apache.org Received: (qmail 26483 invoked by uid 500); 4 Jun 2013 23:08:25 -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 26475 invoked by uid 99); 4 Jun 2013 23:08:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Jun 2013 23:08:25 +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: unknown ~allinclude:spf.protection.outlook.com (nike.apache.org: encountered unrecognized mechanism during SPF processing of domain of mark.bennett@lucidworks.com) Received: from [213.199.154.208] (HELO am1outboundpool.messaging.microsoft.com) (213.199.154.208) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Jun 2013 23:08:17 +0000 Received: from mail94-am1-R.bigfish.com (10.3.201.254) by AM1EHSOBE018.bigfish.com (10.3.207.140) with Microsoft SMTP Server id 14.1.225.23; Tue, 4 Jun 2013 23:07:51 +0000 Received: from mail94-am1 (localhost [127.0.0.1]) by mail94-am1-R.bigfish.com (Postfix) with ESMTP id E2B5A360077 for ; Tue, 4 Jun 2013 23:07:50 +0000 (UTC) X-Forefront-Antispam-Report: CIP:157.56.240.117;KIP:(null);UIP:(null);IPV:NLI;H:BL2PRD0610HT002.namprd06.prod.outlook.com;RD:none;EFVD:NLI X-SpamScore: -2 X-BigFish: PS-2(zz98dI9371I1432I14ffIzz1f42h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1fc6hz31iz8275bhz32i2a8h668h839h944hd25he5bhf0ah1220h1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh162dh1631h1758h18e1h1946h19b5h19ceh1ad9h1b0ah1d0ch1d2eh1d3fh1dfeh1dffh1e1dh1155h) X-Forefront-Antispam-Report-Untrusted: SFV:SKI;SFS:;DIR:OUT;SFP:;SCL:-1;SRVR:CO1PR06MB112;H:CO1PR06MB111.namprd06.prod.outlook.com;LANG:en; Received: from mail94-am1 (localhost.localdomain [127.0.0.1]) by mail94-am1 (MessageSwitch) id 1370387263972639_22084; Tue, 4 Jun 2013 23:07:43 +0000 (UTC) Received: from AM1EHSMHS005.bigfish.com (unknown [10.3.201.247]) by mail94-am1.bigfish.com (Postfix) with ESMTP id E2165A02D7 for ; Tue, 4 Jun 2013 23:07:43 +0000 (UTC) Received: from BL2PRD0610HT002.namprd06.prod.outlook.com (157.56.240.117) by AM1EHSMHS005.bigfish.com (10.3.207.105) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 4 Jun 2013 23:07:37 +0000 Received: from CO1PR06MB112.namprd06.prod.outlook.com (10.242.164.149) by BL2PRD0610HT002.namprd06.prod.outlook.com (10.255.101.37) with Microsoft SMTP Server (TLS) id 14.16.311.1; Tue, 4 Jun 2013 23:07:32 +0000 Received: from CO1PR06MB111.namprd06.prod.outlook.com (10.242.164.145) by CO1PR06MB112.namprd06.prod.outlook.com (10.242.164.149) with Microsoft SMTP Server (TLS) id 15.0.698.13; Tue, 4 Jun 2013 23:07:30 +0000 Received: from CO1PR06MB111.namprd06.prod.outlook.com ([169.254.12.211]) by CO1PR06MB111.namprd06.prod.outlook.com ([169.254.12.211]) with mapi id 15.00.0698.010; Tue, 4 Jun 2013 23:07:29 +0000 From: Mark Bennett To: "" Subject: Re: IndexWriter.commit() performance Thread-Topic: IndexWriter.commit() performance Thread-Index: Ac5hdfRHEH5BwwcSST2KNBPWlBsmnwAAlOWA Date: Tue, 4 Jun 2013 23:07:29 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [68.233.218.146] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: lucidworks.com X-Virus-Checked: Checked by ClamAV on apache.org Although it's not exactly what you asked (and I don't mean this as a sarcas= tic answer), one idea is to not call it directly from your code. Or use th= e options that say "commit with N seconds" This may not be feasible, depending on your requirements, and I'd certainly= respect that. But, if you're looking at old examples and that is what's m= otivating your question, it's good to know about the other options availabl= e. There's also soft commits and NRT gets, also interesting reading. -- Mark Bennett / LucidWorks: Search & Big Data / mark.bennett@lucidworks.com Office: 408-898-4201 / Telecommute: 408-733-0387 / Cell: 408-829-6513 On Jun 4, 2013, at 3:50 PM, Renata Vaccaro wrote: > Hi all, >=20 >=20 >=20 > I'm new to this list and hoping I'm asking this question in the correct > place. I upgraded lucene from a very, very old version to version > 4.2.1. I'm finding that calling IndexWriter.commit() is much slower > than the previous IndexWriter.close() that I was calling with the old > lucene (that didn't have a commit call). It's taking 500ms-1s where > previously the close call was taking about 50ms. I call commit every > time I add a document. I am creating the IndexWriter as follows: >=20 >=20 >=20 > Directory dir =3D FSDirectory.open(index); >=20 > Analyzer analyzer =3D new MsStandardAnalyzer(); >=20 > IndexWriterConfig iwc =3D new IndexWriterConfig(Version.LUCENE_42, > analyzer); >=20 > iwc.setOpenMode(OpenMode.CREATE_OR_APPEND); >=20 > iwc.setRAMBufferSizeMB(256.0); >=20 > IndexWriter writer =3D new IndexWriter(dir, iwc); >=20 >=20 >=20 > Is there something that I can do to make the commit call faster? >=20