lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: Wrapping IndexSearcher so that it is safe?
Date Wed, 11 Nov 2009 22:53:01 GMT
If you want to spend a few bucks, here's part of a reply to a similar
question
from Mike McCandless a day or so ago....

<<<
You can get the book here http://www.manning.com/hatcher3 (NOTE: I'm
one of the authors!).

Chapter 11 in the book has a class called SearcherManager, that
handles the details of reopen/closing the IndexReader while queries
are still in flight, that might be useful here.
>>>

The book is Lucene In Action II. Manning has an "early access program"
(MEAP) that lets you get a PDF version. That class is considerably more
extensive and handles the edge cases as I remember it....

Best
Erick


On Wed, Nov 11, 2009 at 5:41 PM, Jacob Rhoden <jrhoden@unimelb.edu.au>wrote:

> I knew I would have overlooked something, thanks for the help!
>
> On 12/11/2009, at 9:21 AM, Uwe Schindler wrote:
>
>  ....simply do not catch and rethrow the IOException, instead put release
>> in a
>>
>> finally block and let the IOException automatically go upwards.
>>
>>                 this.retain();
>>>                try {
>>>                        TopDocs result = searcher.search(query, limit);
>>>                        return result;
>>>                } finally {
>>>                        this.release();
>>>                }
>>>
>>
>> Less code more secure and effective :-)
>>
>
>
> ____________________________________
> Information Technology Services,
> The University of Melbourne
>
> Email: jrhoden@unimelb.edu.au
> Phone: +61 3 8344 2884
> Mobile: +61 4 1095 7575
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message