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>
        to
        <Set name="requestHeaderSize">
          <Property name="solr.jetty.request.header.size" default="16386" />
        </Set>
      • Save the changes.
      • Restart Solr and Sitecore XP.

Applies to:

CMS 7+

September 30, 2019
September 30, 2019

Reference number:

288837