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:[EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to