Summary
Queries with several OR|AND statements can exceed the maxBooleanClause limit that defaults to 1024. Additionally, if you set the parameter on one core, you may not see the parameter actually being used. The reason is because if there's an inconsistency between cores, so one core has maxBooleanClauses 1024 and the others 4096 (arbitrary value), solr search seems to prefer the 1024 value.
Applies to
All DSE versions running solr.
Sympton
You will hit maxClauseCount limit error, which you can see in the system.log:
Caused by: org.apache.lucene.search.BooleanQuery$TooManyClauses: maxClauseCount is set to 1024 at org.apache.lucene.search.BooleanQuery$Builder.add(BooleanQuery.java:136) at org.apache.lucene.search.BooleanQuery$Builder.add(BooleanQuery.java:124) at org.apache.solr.parser.SolrQueryParserBase.getBooleanQuery(SolrQueryParserBase.java:500) at org.apache.solr.parser.QueryParser.Query(QueryParser.java:146) at org.apache.solr.parser.QueryParser.Clause(QueryParser.java:190) at org.apache.solr.parser.QueryParser.Query(QueryParser.java:107) at org.apache.solr.parser.QueryParser.TopLevelQuery(QueryParser.java:96) at org.apache.solr.parser.SolrQueryParserBase.parse(SolrQueryParserBase.java:155) ... 107 more
Cause
More than 1024 OR|AND statements in the query, which is exceeding the 1024 default set by solr. You may have already increased maxBooleanClauses on a core, but the other cores are still set to 1024. In this case, the 1024 default value seems to take precedence over the cores set with 4096 (arbitrary value).
Solution
Set all solr cores to some value greater than 1024 and reload the cores. You do not need to reindex, but you will need to reload the cores.
You can verify the values for maxBooleanClauses:
SELECT core_name,resource_name,blobastext(resource_value) from dse_system_local.solr_resources;
Verify the maxBooleanClauses in all the solrconfig.xml files in the table above. If any state 1024, then you either did not set it for that core, or you have not reloaded the core. Here's how to set maxBooleanClauses:
<query>
<maxBooleanClauses>4096</maxBooleanClauses>
<filterCache class="solr.SolrFilterCache" highWaterMarkMB="2048" lowWaterMarkMB="1024"/>
<enableLazyFieldLoading>true</enableLazyFieldLoading>
<useColdSearcher>true</useColdSearcher>
<maxWarmingSearchers>16</maxWarmingSearchers>
</query>
And then reload the core:
dsetool -u cassandra -p cassandra reload_core <keyspace>.<table> distributed=true solrconfig=new-solrconfig.xml reindex=false
Proceeding with the above on all cores should resolve the issue.
SUPPORT-967