lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Muir <>
Subject Re: Closing directory in LuceneTestCase causes stacktrace
Date Thu, 28 Jun 2012 23:36:56 GMT

this part of the stacktrace:

> Caused by: java.lang.RuntimeException: unclosed IndexInput: _0.prx
>        at
>        at
>        at
>        at org.apache.lucene.index.SegmentCoreReaders.<init>(
>        at org.apache.lucene.index.SegmentReader.get(
>        at org.apache.lucene.index.SegmentReader.get(
>        at org.apache.lucene.index.DirectoryReader.<init>(
>        at org.apache.lucene.index.ReadOnlyDirectoryReader.<init>(
>        at org.apache.lucene.index.DirectoryReader$1.doBody(
>        at org.apache.lucene.index.SegmentInfos$
>        at
>        at
>        at com.kuripai.lucene.analysis.MetaphoneReplacementAnaylyzerTest.testKoolKat(
>        ... 39 more

is telling you where in your code you opened the un-closed object that
you need to close.

looks to me like the problem is how you open your reader:
new IndexSearcher(;

in this case (where IndexSearcher takes a reader that you passed in),
closing the searcher won't actually close the underlying reader.
you passed it in, so you should be sure to close this reader yourself.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message