lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
Subject Re: TooManyClauses exception in Lucene (1.4)
Date Thu, 16 Mar 2006 20:16:09 GMT
Erick Erickson wrote:
> Could you point me to any explanation of *why* range queries expand this
> way?

It's just what they do.  They were contributed a long time ago, before 
things like RangeFilter or ConstantScoreRangeQuery were written.  The 
latter are relatively recent additions to Lucene and much improve it in 
this regard.

> All in all, it seems that the way the expand makes range queries my last
> choice rather than my first, and I'd like to know what overriding advantage
> they give me in what circumstance that would make them worth the risk.

The primary advantage of a RangeQuery is that the ranking incorporates 
the degree of match of each term in the range, which may be useful for 
wildcard-like searches but is useless for date-like searches.

A RangeFilter must perform much the same work, but does so using less 
memory.  The improvement is largely a constant factor, albeit a big one.

Now that we have RangeFilter and ConstantScoreRangeQuery, we should 
certainly try to point more users towards these by default.  In 
particular, I have long wished to remove the dangerous RangeQuery, 
PrefixQuery, and WildcardQuery from the QueryParser.  (FuzzyQuery 
intelligently limits the number of terms it expands to.)  We could by 
default replace these all with some sort of ConstantScoreQuery or 
ConstantScoreRangeQuery.  This would alter rankings a little in some 
cases, but I personally feel the benefits outweigh the costs.


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

View raw message