[ 
https://issues.apache.org/jira/browse/LUCENE-997?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12555203
 ] 

Paul Elschot commented on LUCENE-997:
-------------------------------------

By using only a HitCollector it cannot be guaranteed that searches will not 
take too long. The reason is that there are searches that take a long time but 
do not collect any docs.

For example consider the case where every even doc has term A and every odd doc 
has term B, and the query requires both A and B. This is going to take an 
amount of time that is linear in the size of the index but no document will be 
collected.

This means that every conjunction (boolean queries with more than one required 
clause, phrase queries, span near queries) will need to check for timeout. Also 
a HitCollector with a timeout facility will need a way
to be informed of a timeout when no document is collected.

> Add search timeout support to Lucene
> ------------------------------------
>
>                 Key: LUCENE-997
>                 URL: https://issues.apache.org/jira/browse/LUCENE-997
>             Project: Lucene - Java
>          Issue Type: New Feature
>            Reporter: Sean Timm
>            Priority: Minor
>         Attachments: HitCollectorTimeoutDecorator.java, 
> LuceneTimeoutTest.java, MyHitCollector.java, timeout.patch, timeout.patch
>
>
> This patch is based on Nutch-308. 
> This patch adds support for a maximum search time limit. After this time is 
> exceeded, the search thread is stopped, partial results (if any) are returned 
> and the total number of results is estimated.
> This patch tries to minimize the overhead related to time-keeping by using a 
> version of safe unsynchronized timer.
> This was also discussed in an e-mail thread.
> http://www.nabble.com/search-timeout-tf3410206.html#a9501029

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to