Documentation > Errors in Solr > Content length exceeds upload limit of 2048 KB

📦 Adjusting Solr Upload Limits and Boolean Clauses Like a Pro

When your Solr-powered app says “the file’s too big” or “too many boolean clauses!”—don’t panic. Here’s how to tweak your solrconfig.xml so you can upload more, search harder, and (almost) never hit a wall.


🚀 How to Change the Form Data Upload Limit

The key setting: formdataUploadLimitInKB in your solrconfig.xml file.

📝 Step-by-Step

  1. Open your Opensolr Index Control Panel:
    https://opensolr.com/admin/solr_manager/tools/INDEX_NAME

  2. Navigate to the Config Files Editor tab.
    Select solrconfig.xml.

  3. Look for the <requestDispatcher> directive.
    Example: xml <requestDispatcher handleSelect="false" multipartUploadLimitInKB="2048000" formdataUploadLimitInKB="2048" />

  4. multipartUploadLimitInKB – For files uploaded via multipart POST.
  5. formdataUploadLimitInKB – For files uploaded as form data.

  6. Increase the value as needed.
    Warning: Don’t make it TOO big—your JVM heap and security folks will not thank you.

Solr Config Example


⚠️ Heads Up #1: Boolean Clauses

No matter how big you set those upload limits, if your query contains too many boolean clauses (lots of OR or AND), Solr will throw a “too many boolean clauses” error.

Solution:
Increase maxBooleanClauses in your solrconfig.xml:

<maxBooleanClauses>2048</maxBooleanClauses>

Boolean Clauses Example


🧠 Heads Up #2: Alternate Query Strategies

If you’re hitting the limit even after increasing it, consider splitting your mega-query into several smaller queries and combining results in your app (think of it as Solr-powered pagination, but for logic!).

  • Example:
  • Query 1:
    https://opensolr-server.solrcluster.com/solr/production/select?q=*:*&fq=field_name:(VAL1 OR ... OR VALn)
  • Query 2:
    https://opensolr-server.solrcluster.com/solr/production/select?q=*:*&fq=field_name:(VALn+1 OR ... OR VALm)
  • And so on…

Where n and m are each less than your maxBooleanClauses setting.


🔄 Load Balancing Bonus

If you’re running Opensolr with a Resilient Cluster Solution, you get: - Load balancing for multiple simultaneous queries - Better resiliency - Much faster response times!


Pro Tip:
Remember to always back up your config before making changes. Solr has a sense of humor, but only if you do, too. 😄







Review us on Google Business
ISO-9001 CERTIFIED ISO-27001 CERTIFIED