lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cocula Remi" <rcoc...@sopragroup.com>
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 [mailto:erik@ehatchersolutions.com]
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 ?

IndexSearcher.close:

   public void close() throws IOException {
     if(closeReader)
       reader.close();
   }

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)?

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message