Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 27716 invoked from network); 19 Nov 2008 05:23:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Nov 2008 05:23:52 -0000 Received: (qmail 70484 invoked by uid 500); 19 Nov 2008 05:23:53 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 70445 invoked by uid 500); 19 Nov 2008 05:23:53 -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 70434 invoked by uid 99); 19 Nov 2008 05:23:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Nov 2008 21:23:52 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=RCVD_IN_BL_SPAMCOP_NET,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [67.195.8.215] (HELO web110315.mail.gq1.yahoo.com) (67.195.8.215) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 19 Nov 2008 05:22:30 +0000 Received: (qmail 65444 invoked by uid 60001); 19 Nov 2008 05:22:13 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Message-ID; b=rp0MalubUcZAKNoPt/V5PLyftJcLAAe/jB1pXO2lJyMQlmWBLZsNTxqUVmFCRawQvfp0Eo1zaP64p8islX5b4cUQ0Zq+a1PvhfaAIKovHCueeAgBKT5ZRbZFPLBOmVWN5HbtPL9flifJqgijXuqF9iVFDFVKCdaO6Vom7EOaSYY=; X-YMail-OSG: UfoIts8VM1mt_DQcFkZtw2JYjhrWMGrBsR4VgNrRelb7UUu717EF51rV2Sev4KRT2cKMcx462S.S7SF2QHdSjyLGt9QTy57a5NYgzKmUwl6rTRW76BKmQlUsvQ5XlLIKC1fE.r2kd5bbAd41mDQVi6G_4WkEH8LhOos6LASTGvxXQ0wz.CoTtJyHVu7DTWGQhhATybB_yO8kPGQ- Received: from [116.197.178.83] by web110315.mail.gq1.yahoo.com via HTTP; Tue, 18 Nov 2008 21:22:12 PST X-Mailer: YahooMailWebService/0.7.260.1 Date: Tue, 18 Nov 2008 21:22:12 -0800 (PST) From: Cool The Breezer Reply-To: techcool.kumar@yahoo.com Subject: Re: Reopen IndexReader To: java-user@lucene.apache.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <942431.65145.qm@web110315.mail.gq1.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org I had same kind of problem and I somehow managed to find a work around by initializing IndexSearcher from new reader. try { IndexReader newReader = reader.reopen(); if (newReader != reader) { // reader was reopened reader.close(); reader = null; } reader = newReader; searcher = new IndexSearcher(newReader); } catch (Exception e) { e.printStackTrace(); } --- On Tue, 11/18/08, Michael McCandless wrote: > From: Michael McCandless > Subject: Re: Reopen IndexReader > To: java-user@lucene.apache.org > Date: Tuesday, November 18, 2008, 7:52 AM > Well... we certainly do our best to have each release be > stable, but we do make mistakes, so you'll have to use > your own judgement on when to upgrade. > > However, it's only through users like yourself > upgrading that we then find & fix any uncaught issues in > each new release. > > Mike > > Ganesh wrote: > > > I am creating IndexSearcher using String, this is > working fine with version 2.3.2. > > I tried by replacing Directory ctor of IndexSearcher > and it is working fine with v2.4. > > > > I have recently upgraded from v2.3.2 to 2.4. Is v2.4 > stable and i could more forward with this or shall i revert > back to 2.3.2? > > > > Regards > > Ganesh > > > > > > ----- Original Message ----- From: "Michael > McCandless" > > To: > > Sent: Tuesday, November 18, 2008 4:59 PM > > Subject: Re: Reopen IndexReader > > > > > >> > >> Did you create your IndexSearcher using a String > or File (not Directory)? > >> > >> If so, it sounds like you are hitting this issue > (just fixed this morning, on 2.9-dev (trunk)): > >> > >> > https://issues.apache.org/jira/browse/LUCENE-1453 > >> > >> The workaround is to use the Directory ctor of > IndexSearcher. > >> > >> Mike > >> > >> Ganesh wrote: > >> > >>> Hello all, > >>> > >>> I am using version 2.4. The following code > throws AlreadyClosedException > >>> > >>> IndexReader reader = > searcher.getIndexReader(); > >>> IndexReader newReader = reader.reopen(); > >>> if (reader != newReader) { > >>> reader.close(); > >>> boolean isCurrent = > newReader.isCurrent(); //throws exception > >>> } > >>> > >>> Full list of exception: > >>> -------------------- > >>> > org.apache.lucene.store.AlreadyClosedException: this > Directory is closed > >>> at > org.apache.lucene.store.Directory.ensureOpen(Directory.java: > 220) > >>> at > org.apache.lucene.store.FSDirectory.list(FSDirectory.java: > 320) > >>> at org.apache.lucene.index.SegmentInfos > $FindSegmentsFile.run(SegmentInfos.java:533) > >>> at org .apache > .lucene.index.SegmentInfos.readCurrentVersion(SegmentInfos.java:366) > >>> at org .apache .lucene > .index.DirectoryIndexReader.isCurrent(DirectoryIndexReader.java:188) > >>> at > MailIndexer.IndexSearcherEx.reOpenDB(IndexSearcherEx.java: > 102) > >>> > >>> Please correct me, if i am wrong. > >>> > >>> Regards > >>> Ganesh > >>> > >>> Send instant messages to your online friends > http://in.messenger.yahoo.com > >>> > --------------------------------------------------------------------- > >>> 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 > > > > Send instant messages to your online friends > http://in.messenger.yahoo.com > > > --------------------------------------------------------------------- > > 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 --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org