lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: TooManyBooleanClauses exception
Date Mon, 08 Dec 2003 23:07:18 GMT
On Monday, December 8, 2003, at 05:47  PM, DMGoodstein@lbl.gov 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:
> org.apache.lucene.search.BooleanQuery$TooManyClauses
>         at
> org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:109)

I'm guessing you're getting this exception from an IndexSearcher.search 
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?

	Erik


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


Mime
View raw message