lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: Preventing "killer" queries
Date Tue, 07 Feb 2006 20:10:35 GMT
mark harwood wrote:
> For these outlier situations is it worth adding a
> "maxDf" property to TermQuery like BooleanQuery's
> maxClause query-time control? I could fix my problem
> in my own app-specific query construction code but I
> wonder if others would find it a useful fix to add to
> TermQuery in the Lucene core?

Another approach is to use a TopDocCollector (in 1.9 only) and override 
the collect() method to, if too much time has transpired, throw an 
exception to stop the query with the results found thus far.

For an example of how to extend TopDocCollector, see:

http://svn.apache.org/viewcvs.cgi/lucene/nutch/trunk/src/java/org/apache/nutch/searcher/LuceneQueryOptimizer.java?view=markup

Doug

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


Mime
View raw message