[ https://issues.apache.org/jira/browse/LUCENE-997?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12552170 ]
Doron Cohen commented on LUCENE-997: ------------------------------------ Nice, I didn't think of this. So with this understanding the timer thread (with long vs int) makes sense while in Java 1.4, then in 1.5 System.nanoTime will do. The suggested patch relied on collect() being called, and so if a scorer takes long going over all the posting lists but fails to find a single match after the time passed, the search operation will not be stopped. I guess it is a fair assumption that this would be very rare... (so would be a system clock shift... : - ) ) Also important to understand is what happens with IO resources once search is aborted with timeout exception. Current patch does not close the underlying streams (I mean IndexInput clones). I think this is ok, because once the search is aborted and there are no more references to the weights&scorers, the IndexInput clones would be eventually garbage collected. Others? > 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: LuceneTimeoutTest.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]