Solr query length issue

  • Search operations might fail if the query length exceeds the Solr request header size limit. This results in the following error message:

    Exception: System.Net.WebException
    Message: The remote server returned an error: (414) URI Too Long.
    Source: System
       at System.Net.HttpWebRequest.GetResponse()
       at HttpWebAdapters.Adapters.HttpWebRequestAdapter.GetResponse()
       at SolrNet.Impl.SolrConnection.GetResponse(IHttpWebRequest request)
       at SolrNet.Impl.SolrConnection.Get(String relativeUrl, IEnumerable`1 parameters)
    1. Review the code resulting in long queries. We recommend that you rewrite queries to shorten their length. Queries with a lot of clauses are executed slower and increase resource consumption.
    2. Increase the limit on the request header size at Solr side. For example, if you are running Solr on Jetty, perform the following steps:
      • Open the <solr_root_folder>\server\etc\jetty.xml file.
      • Change
        <set name="requestHeaderSize">
          <property name="solr.jetty.request.header.size" default="8192" />
        <set name="requestHeaderSize">
          <property name="solr.jetty.request.header.size" default="16386" />
      • Save the changes.
      • Restart Solr and Sitecore XP.

Applies to:

CMS 7.0 Initial Release - 9.3 Initial Release

CMS 10.0 Initial Release

September 30, 2019
August 04, 2020

Reference number: