On Monday, December 8, 2003, at 05:47 PM, [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to