Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 48579 invoked from network); 8 Dec 2005 16:20:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Dec 2005 16:20:19 -0000 Received: (qmail 53435 invoked by uid 500); 8 Dec 2005 16:20:12 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 53414 invoked by uid 500); 8 Dec 2005 16:20:12 -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 53403 invoked by uid 99); 8 Dec 2005 16:20:12 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2005 08:20:12 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [70.183.3.246] (HELO TSIEXCHANGE.tridsys.com) (70.183.3.246) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2005 08:20:11 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C5FC13.7F43E88D" Subject: delete and optimize Date: Thu, 8 Dec 2005 11:23:49 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: delete and optimize Thread-Index: AcX8EHbyOECZz5g1TymwHdTEBDpNPwAAbxEgAABhXCA= From: "Dan Liu" To: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C5FC13.7F43E88D Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, =20 What is the difference between following approaches? =20 Approach1 1) open IndexWriter and index documents 2) optimize the indexWriter and close the indexWriter 3) open the IndexReader and delete some documents from the same index 4) close the IndexReader =20 Approach2 1) open IndexWriter and index documents 2) close the IndexWriter 3) open the IndexReader and delete some documents from the same index 4) close the IndexReader 5) open the IndexWriter again 6) optimize the indexWriter and close the indexWriter =20 The Approach1 is definitely faster than Approach2. The difference is that the Approach1 does not renumber the document nubmer. While with the Approach2, the document nubmer reflects the renumbered doucements. In other words, that reader.maxDoc() gives different result between Approach1 and 2. =20 Since the optimize only affects the search speed, will I have any performance diffenece between these approaches while searching? (note: the documents are actually deleted when IndexReader is closed) =20 Thanks /dan =20 ------_=_NextPart_001_01C5FC13.7F43E88D--