You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by "Paul J. Lucas" <pa...@lucasmail.org> on 2008/07/16 06:22:36 UTC
Interrupting a query
If a complicated query is running in a Thread, how does Lucene respond
to Thread.interrupt()? I want to be able to interrupt an in-progress
query.
- Paul
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Interrupting a query
Posted by Grant Ingersoll <gs...@apache.org>.
You can't with that call. You have to make one that uses a
HitCollector, and your hit collector needs to be interruptable and it
probably needs to handle your sorting. Sounds like a nice
contribution/patch.
Sorry, I can't offer a better solution.
-Grant
On Jul 22, 2008, at 2:48 PM, Paul J. Lucas wrote:
> If I'm calling:
>
> IndexSearcher.search( query, sortOrder );
>
> how, exactly, can I do what you suggest? *That* call is what I want
> to interrupt.
>
> - Paul
>
>
> On Jul 18, 2008, at 3:51 AM, Grant Ingersoll wrote:
>
>> True, but I think the approach is similar, in that you need to have
>> the hit collector check to see if your interrupt flag has been set
>> and then exit out.
>>
>> On Jul 16, 2008, at 9:54 AM, Paul J. Lucas wrote:
>>
>>> That has nothing to do with interrupting a query at some arbitrary
>>> time.
>>>
>>> On Jul 16, 2008, at 5:14 AM, Grant Ingersoll wrote:
>>>
>>>> See https://issues.apache.org/jira/browse/LUCENE-997
>>>>
>>>> On Jul 16, 2008, at 12:22 AM, Paul J. Lucas wrote:
>>>>
>>>>> If a complicated query is running in a Thread, how does Lucene
>>>>> respond to Thread.interrupt()? I want to be able to interrupt
>>>>> an in-progress query.
>>>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
--------------------------
Grant Ingersoll
http://www.lucidimagination.com
Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Interrupting a query
Posted by "Paul J. Lucas" <pa...@lucasmail.org>.
If I'm calling:
IndexSearcher.search( query, sortOrder );
how, exactly, can I do what you suggest? *That* call is what I want
to interrupt.
- Paul
On Jul 18, 2008, at 3:51 AM, Grant Ingersoll wrote:
> True, but I think the approach is similar, in that you need to have
> the hit collector check to see if your interrupt flag has been set
> and then exit out.
>
> On Jul 16, 2008, at 9:54 AM, Paul J. Lucas wrote:
>
>> That has nothing to do with interrupting a query at some arbitrary
>> time.
>>
>> On Jul 16, 2008, at 5:14 AM, Grant Ingersoll wrote:
>>
>>> See https://issues.apache.org/jira/browse/LUCENE-997
>>>
>>> On Jul 16, 2008, at 12:22 AM, Paul J. Lucas wrote:
>>>
>>>> If a complicated query is running in a Thread, how does Lucene
>>>> respond to Thread.interrupt()? I want to be able to interrupt an
>>>> in-progress query.
>>>>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Interrupting a query
Posted by Grant Ingersoll <gs...@apache.org>.
True, but I think the approach is similar, in that you need to have
the hit collector check to see if your interrupt flag has been set and
then exit out.
-Grant
On Jul 16, 2008, at 9:54 AM, Paul J. Lucas wrote:
> That has nothing to do with interrupting a query at some arbitrary
> time.
>
> - Paul
>
>
> On Jul 16, 2008, at 5:14 AM, Grant Ingersoll wrote:
>
>> See https://issues.apache.org/jira/browse/LUCENE-997
>>
>> -Grant
>>
>> On Jul 16, 2008, at 12:22 AM, Paul J. Lucas wrote:
>>
>>> If a complicated query is running in a Thread, how does Lucene
>>> respond to Thread.interrupt()? I want to be able to interrupt an
>>> in-progress query.
>>>
>>> - Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Interrupting a query
Posted by "Paul J. Lucas" <pa...@lucasmail.org>.
That has nothing to do with interrupting a query at some arbitrary time.
- Paul
On Jul 16, 2008, at 5:14 AM, Grant Ingersoll wrote:
> See https://issues.apache.org/jira/browse/LUCENE-997
>
> -Grant
>
> On Jul 16, 2008, at 12:22 AM, Paul J. Lucas wrote:
>
>> If a complicated query is running in a Thread, how does Lucene
>> respond to Thread.interrupt()? I want to be able to interrupt an
>> in-progress query.
>>
>> - Paul
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Interrupting a query
Posted by Grant Ingersoll <gs...@apache.org>.
See https://issues.apache.org/jira/browse/LUCENE-997
-Grant
On Jul 16, 2008, at 12:22 AM, Paul J. Lucas wrote:
> If a complicated query is running in a Thread, how does Lucene
> respond to Thread.interrupt()? I want to be able to interrupt an in-
> progress query.
>
> - Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
--------------------------
Grant Ingersoll
http://www.lucidimagination.com
Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org