Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 17500 invoked from network); 11 May 2007 05:33:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 May 2007 05:33:06 -0000 Received: (qmail 79371 invoked by uid 500); 11 May 2007 05:33:04 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 79331 invoked by uid 500); 11 May 2007 05:33:04 -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 79320 invoked by uid 99); 11 May 2007 05:33:04 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2007 22:33:04 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of Andreas.Guther@markettools.com designates 72.5.112.150 as permitted sender) Received: from [72.5.112.150] (HELO mvmail04.markettools.com) (72.5.112.150) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2007 22:32:57 -0700 Received: from WDCCPMAIL01.markettools.com ([10.64.64.33]) by mvmail04.markettools.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 10 May 2007 22:32:34 -0700 x-mimeole: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: How to re-open the IndexSearcher's IndexReader Date: Thu, 10 May 2007 22:32:32 -0700 Message-ID: <3FB08D6A21B3EC4D8749EF6D9E626278012E5DB7@WDCCPMAIL01.markettools.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: How to re-open the IndexSearcher's IndexReader Thread-Index: AceTjcXzGiGqrfEBTmOSbQvKZ2tL7w== From: "Andreas Guther" To: X-OriginalArrivalTime: 11 May 2007 05:32:34.0906 (UTC) FILETIME=[C77083A0:01C7938D] X-Virus-Checked: Checked by ClamAV on apache.org Hi, How can I re-use an IndexSearcher and keep track of changes to the index? I am dealing with Index Directories of several GB. Opening and IndexSearcher is very expensive and can take several seconds. Therefore I am caching the IndexSearcher for re-use. Our indexes are frequently updated. Before I pass the IndexSearcher retrieved from the cache I use the IndexSearcher getIndexReader() method to get the IndexReader and to check if the IndexReader is current (via the isCurrent() method). The isCurrent method is documented as follows: /** * Check whether this IndexReader still works on a current version of the index. * If this is not the case you will need to re-open the IndexReader to * make sure you see the latest changes made to the index. *=20 * @throws IOException */ Opening a new IndexReader is trivial. But then how do I set the IndexSearcher's reader to the new one without getting a new instance? Thanks in advance for any help. Andreas --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org