lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ganesh" <emailg...@yahoo.co.in>
Subject Reopen IndexReader
Date Tue, 18 Nov 2008 10:55:48 GMT
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


Mime
View raw message