lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrzej Bialecki ...@getopt.org>
Subject Re: search timeout
Date Sun, 18 Mar 2007 10:04:15 GMT
Chris Hostetter wrote:
> Ack! ... this is what happens when i only skim a patch and then write with
> my odd mix of authority and childlike speling....
>
> : * it creates a single (static) timer thread, which counts the "ticks",
> : every couple hundred ms (configurable). It uses a volatile int counter,
> : therefore avoiding the need to synchronize.
> :
> : * each HitColector records the start tick count in its constructor, and
> : then checks the current tick count in collect(...). If the difference is
>
> So i was way wrong about the Timer per search ... but it seems like this
> appraoch still has the downside that "long" searches resulting in no
> matches won't time out (because collect will never be called and the tick
> counter will never be compared)
>
> Was this considered a non issue for Nutch because the query structure is
> typiclly well known and quereis with no results usually return
> imeediately? ... in the totally generic case, this isn't a safe
>   

This was implemented as an easy way to control the maximum search time 
for typical queries. I'm open for suggestions how to improve it. One 
thing that sticks like a sore thumb is the use of exceptions to break 
the loop - IMHO the collect() method should simply return a boolean or 
int code that tells other parts of Lucene to stop collecting hits.


> assumption.  Crazy complex BooleanQueries, or worse still: arbitrary
> client written Query classes, could spend untold times advancing to the
> "next" match (which may not exist at all)
>   

Yes, any suggestions are welcome :)

Andrzej

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message