lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Harwood <>
Subject Re: Improving TimeLimitedCollector
Date Wed, 24 Jun 2009 22:07:40 GMT
> I think the Collector approach makes the most sense to me, since  
> it's the only object I fully control in the search process. I cannot  
> control Query implementations, and I cannot control the decisions  
> made by IndexSearcher. But I can always wrap someone else's  
> Collector with TLC and pass it to search().

Isn't another option to have a TimeLimitedIndexReader?

Clients would need to make a call before the start of any timeout-able  
activity e.g.

     timeLimitedReader.startActivity(MAX_ALLOWED_DURATION);  //sets a  
    //run query etc

All invocations on special IndexReader, TermEnum, TermDocs etc  
subclasses can then periodically check to see if the calling thread  
has exceeded its allotted time. This would be a potentially non- 
invasive way of making all filters', queries', scorers' etc read  
activity subject to some time limit as they all typically have to  
invoke IndexReader-related classes relatively frequently as part of  
their processing.

Not sure how quick you can make all the underlying time checks though.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message