lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: TooManyBooleanClauses exception
Date Mon, 08 Dec 2003 23:07:18 GMT
On Monday, December 8, 2003, at 05:47  PM, wrote:
> If I generate a query using QueryParser and a
> standard analyzer, in some cases I'm getting a
> TooManyBooleanClauses exception, e.g.:
> [2003-12-08 14:39:23] [  debug1 ]  query is +glucose
> -kog* always:1
> [2003-12-08 14:39:23] [--ERROR--] Exception in
> searchAnnotations:
>         at

I'm guessing you're getting this exception from an 
rather than a QueryParser.parse, right?

>  Is there a way to reset the maximum number of
> boolean clauses for a non-boolean query, or to at
> least access the boolean sub queries and modify them?

You can call BooleanQuery.setMaxClauseCount(n).  The default is 1024.   
I'm not sure what you mean by reseting it for non-boolean query, since 
that restriction only applies to boolean queries.  What is happening is 
the the wildcard kog* is expanding to all terms that begin with "kog" - 
you must have quite a lot of those, huh?


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

View raw message