Is there a size or term limit for a Solr query string when using HTTP POST?

There is no limit on the Solr side - we regularly use Solr in a similar way with tens of thousands of IDs in the query.

You need to look at the settings for your servlet container (Tomcat, Jetty etc.) and increase the maximum POST size. Look up maxPostSize if you are using Tomcat and maxFormContentSize if you are using Jetty.


As of Solr 6.0 there is a maxBooleanClauses configuration within Solr - defaults to 1024.

I wrote a unit test to confirm and confirmed the limitation (with Solr 5.3).

See more here https://wiki.apache.org/solr/SolrConfigXml#The_Query_Section

FWIW there is an open Solr JIRA to remove it so it may be removed in the future https://issues.apache.org/jira/browse/SOLR-4586