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.

Community
  • 1
  • 1
Sahil
  • 3,338
  • 1
  • 21
  • 43

3 Answers3

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.

Abhijit Bashetti
  • 8,518
  • 7
  • 35
  • 47
  • 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 05 '16 at 04: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/

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

Ricardo Machado
  • 784
  • 6
  • 22