Re: IndexSearcher.close() removed in 4.0

2013-02-19 Thread Eric Charles
Ok, as we can not construct the searcher with a directory, we don't need to close it anymore. Agree that InputStream is not analogous, but I was thinking you were refering to it in your previous mail. Thx again, Eric On 19/02/2013 17:59, Uwe Schindler wrote: This example lacks some similar

Re: IndexSearcher.close() removed in 4.0

2013-02-19 Thread Uwe Schindler
This example lacks some similarities: FilterInputStream is itsself an InputStream. IndexSearcher is a completely different class with totally different functionality. The Index Reader holds the resources. This was never different in previous Lucene versions! In earlier version you were able to o

Re: IndexSearcher.close() removed in 4.0

2013-02-19 Thread Eric Charles
Hi Uwe, Thx for to point that IndexSearcher does not retain resources. If we continue the analogy with the FilterInputStream which decorates the InputStream, you can see that FIS.close calls close() on the wrapped IS [1]. But this may be not to be compared with the Searcher/Reader way of work

Re: IndexSearcher.close() removed in 4.0

2013-02-19 Thread Uwe Schindler
IndexSearcher in Lucene 4.0 does not hook resources and never will. IndexSearcher is a thin wrapper class which is not IO related so implementing Closeable is simply wrong. This is the same paradigm like a input stream should never be closed by a method unless explicitly documented. The code tha

Re: IndexSearcher.close() removed in 4.0

2013-02-19 Thread Eric Charles
Hi Simon, Many thx for this info. I am just digging into the new Lucene3/4 goodies, so excuse my stupid questions. Having a SearcherManager sounds great, I will try it. Still I like the paragdim to 'close' the resources I have created. Why not having a close() that simply does nothing for no

Re: IndexSearcher.close() removed in 4.0

2013-02-19 Thread Simon Willnauer
Hey Eric, the problem here is more tricky than it seems. and IndexReader is a point in time snapshot that should be shared as long as possible. If you share this across threads you can not just call close you need to count references. We have utilities for this (ReferenceManager / SearcherManager)

Re: IndexSearcher.close() removed in 4.0

2013-02-18 Thread Eric Charles
Hi, Why not having the IS#close() calling the wrapped IR#close() ? I would be happier having to only deal with the Searcher once created and forget it wraps a Reader: I create a Searcher, I close it. Thx, Eric On 18/02/2013 22:20, Simon Willnauer wrote: On Mon, Feb 18, 2013 at 7:32 PM, saisa

Re: IndexSearcher.close() removed in 4.0

2013-02-18 Thread Simon Willnauer
On Mon, Feb 18, 2013 at 7:32 PM, saisantoshi wrote: > I understand from the JIRA ticket(Lucene-3640) that the IndexSearcher.close() > is no-op operation but not very clear on why it is a no-op? Could someone > shed some light on this? We were using this method in the older versions and > is it saf

IndexSearcher.close() removed in 4.0

2013-02-18 Thread saisantoshi
I understand from the JIRA ticket(Lucene-3640) that the IndexSearcher.close() is no-op operation but not very clear on why it is a no-op? Could someone shed some light on this? We were using this method in the older versions and is it safe now to remove this call. Just want to understand the conseq