lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cocula Remi" <>
Subject RE: closing an IndexSearcher
Date Thu, 20 Jan 2005 10:26:28 GMT
I have run my code with eclipse debugger and the IndexReader is closed (I mean it steps into
the reader.close() statement)
but the search over this IndexReader still works.

Should a query work on a closed indexReader or should it throw an IOException ?

-----Message d'origine-----
De : Erik Hatcher []
Envoyé : mercredi 19 janvier 2005 18:31
À : Lucene Users List
Objet : Re: closing an IndexSearcher

On Jan 19, 2005, at 12:14 PM, Cocula Remi wrote:

> Hi ,
> I remarked that after closing an IndexSearcher, queries on this 
> Seacher will still run.
> My question is : why not always closing an IndexSearcher ?


   public void close() throws IOException {

However, you open it with a String:

> -----------------------------------------------------
> searcher = new IndexSearcher("c:\\tmp\\index");

Which should close the underlying IndexReader.

Maybe this was a bug that has since been fixed in CVS (which is the 
code I'm referencing)?


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

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

View raw message