lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luke Francl <>
Subject Re: Bug in the BooleanQuery optimizer? ..TooManyClauses
Date Fri, 12 Nov 2004 22:41:45 GMT
On Fri, 2004-11-12 at 14:52, Daniel Naber wrote:

> There are two different issues: first, reorder the query so that those 
> terms with less matches appear first, because as soon as the first term 
> with 0 matches occurs, search stops. There will probably be a 
> non-so-difficult implementation for that, but this will have more overhead 
> than it saves time I guess.

It could be done only with searches that have expansions (RangeQuery,
WildcardQuery, etc) to prevent unnecessary work...

> The other thing is that prefix queries get expanded first, then the search 
> happens. And that TooManyQueries exception happens when expanding the 
> query, not during search. I'm not sure, but I think that's difficult to 
> change, at least in a clean way.

Expansion (and thus TooManyClauses) happens during Query.weight(), which
is right before the search. Maybe after it's rewriten the query could be
tested for instanceof BooleanQuery and then see if
BooleanQuery.getClauses().length > BooleanQuery.maxClauseCount?

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

View raw message