You can increase that limit in your solrconfig.xml:
<query>
<!-- Maximum number of clauses in a boolean query... can affect range
or wildcard queries that expand to big boolean queries.
An exception is thrown if exceeded.
-->
<maxBooleanClauses>1024</maxBooleanClauses>
Don't go wild with it, but upping it to 2000 or 5000 shouldn't be a big deal
considering that hardware performance has increased significantly since
Lucene was started.
-- Jack Krupansky
-----Original Message-----
From: Shawn Heisey
Sent: Wednesday, November 21, 2012 12:02 PM
To: solr-user@lucene.apache.org
Subject: Re: Pls help: Very long query - what to do?
On 11/21/2012 8:53 AM, Luis Cappa Banda wrote:
Do not forget to increase maxBooleanClauses.
I believe this is the culprit right here. I counted 1576 instances of
"OR" in the long query, which is rather a lot higher than the default
maxBooleanClauses value of 1024.
I think that the maxBooleanClauses parameter (and its default) exist for
good reason, probably to reduce the likelihood of resource exhaustion.
It can't scale to many thousands or millions of clauses.
If possible, it would be a good idea to redesign so you can stay lower
than 1024. I construct a query like this when I do document deletes,
and I limit it to 512 records at a time.If you can't redesign, be aware
that you won't be able to scale indefinitely, even if you change
maxBooleanClauses.
Thanks,
Shawn