Solr request returning a 400 (Bad Request) response
I was troubleshooting an issue for a client the other day where certain Solr requests were returning a 400 (Bad Request) error response. There were actually 2 separate issues:
1. The Tomcat servlet and/or the web server in front of it (in this case an HA Proxy server) can't process the request because it's too big.
2. The Solr query parameter contains too many boolean clauses (the error actually says 'too many boolean clauses').
To fix the issue with the web server
If you use HA Proxy, you can override the value of this setting: tune.bufsize
If you use Nginx, it looks like this setting is the one to override: large_client_header_buffers
To fix the issue with Tomcat (returning a blank page)
In server.xml, add maxHttpHeaderSize to the Connector for Solr to override the default value (which I believe is 8k in Tomcat 7). For example:
<Connector port="8983" protocol="HTTP/1.1" maxHttpHeaderSize="65536" connectionTimeout="20000" redirectPort="8443" />
To fix the issue with Solr
Change the value of maxBooleanClauses (default is 1024) in solrconfig.xml. For example:
<maxBooleanClauses>2048</maxBooleanClauses>