4

I keep getting too many OR clauses error in Rails with Solr. I have even increased the maxBooleanClauses limit to 10240 by logging into the Solr Admin UI, just to see if it fixed the issue. But it did not.

How can I fix this issue. Whenever a user performs a search there are too many or clauses?

I have tried this solution but it did not work. Is there any other place where I should update the count.

1
  • modify the maxBooleanClauses variable in solrconfig.xml file and get rid of the exception Oct 4, 2016 at 8:17

3 Answers 3

1

Modify the maxBooleanClauses variable in solrconfig.xml file.

This will help you to get rid of the exception.

You can adjust that parameter in solrconfig.xml

<maxBooleanClauses>3024</maxBooleanClauses> 

Modify the number.

1
  • Thanks @abhijit, I tried doing that inside one folder called, solr/sitename/solrconfig.xml, I even did it in the cores which I have created for my website(solr/my_core/conf/solrconfig.xml) but it didn't work. I still keep getting the same error.
    – Sahil
    Oct 5, 2016 at 4:01
0

To avoid this exception you can set maxBooleanClauses config in Solr solrconfig.xml

Moreover, still a jira ticket is open for permanent fix

https://issues.apache.org/jira/browse/SOLR-4586

But please remember that changing this limit can have a negative effect on performance and memory usage. http://solr.pl/en/2011/12/19/do-i-have-to-look-for-maxbooleanclauses-when-using-filters/

1
  • Yes I restarted the instance.
    – Sahil
    Oct 6, 2016 at 0:40
0

I found out that if the value on <maxBooleanClauses> inside the <query> tag is higher than the maxBooleanClauses from the global context, it will get ignored.

You can try to override or create a variable on the global context like this:

<solr>
    <int name="maxBooleanClauses">${solr.max.booleanClauses:10240}</int>
...

Here are some useful links:

https://solr.apache.org/guide/8_1/format-of-solr-xml.html#global-maxbooleanclauses https://solr.apache.org/guide/8_1/query-settings-in-solrconfig.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.