On Sun, May 22, 2011 at 4:48 PM, Devon H. O'Dell <[email protected]> wrote:
> I have my own collector, but implemented this functionality by running
> the search in a thread pool and terminating the FutureTask running the
> job if it took longer than some configurable amount of time. That
> seemed to do the trick for me. (In my case, the IndexReader is
> explicitly opened readonly, so I'm not too worried about it).

This can be super dangerous if you use Future. cancel() ie.
Thread.interrupt(). If the interrupt is called while you are reading
from a NIO FileDescriptor the channel will be closed and Lucene can
not recover from that state if the file has already been merged away.
Your Reader will get ChannelAlreadyClosed exceptions for any
subsequent access. You should prevent this.
see FSDirectory Javadoc
http://lucene.apache.org/java/3_1_0/api/core/org/apache/lucene/store/FSDirectory.html

simon
>
> --dho
>
> 2011/5/22 Simon Willnauer <[email protected]>:
>> you can impl. you own collector and notify the collector to stop if you need 
>> to.
>> simon
>>
>> On Sun, May 22, 2011 at 12:06 PM, liat oren <[email protected]> wrote:
>>> Hi Everyone,
>>>
>>> Is there a way to stop a multi search in the middle?
>>>
>>> Thanks a lot,
>>> Liat
>>>
>>
>> ---------------------------------------------------------------------
>> 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