Skip to main content

I found the issue for my Solr problems. In my case the issue was in the Solrconfig, not Sitecore. The issue is that the default settings for the /select request somehow were changed to return JSON.

Our team has a templated set of Solr settings. Somehow those settings got edited incorrectly thus cause JSON to be returned when XML was the expected default.

Here's the configuration that caused the problem:

    <requestHandler name="/select" class="solr.SearchHandler">
      <!-- default values for query parameters can be specified, these
         will be overridden by parameters in the request
      -->
       <bool name="terms">true</bool> REMOVED
       <lst name="defaults">
         <str name="echoParams">explicit</str>
         <str name="wt">json</str> REMOVED
         <str name="indent">true</str> REMOVED
         <str name="df">text</str>
         <int name="rows">10</int>
         <bool name="terms">true</bool> REMOVED
       </lst>
       <arr name="last-components">  REMOVED ELEMENT
         <str>terms</str>
       </arr>
    </requestHandler>

Where the final configuration should have looked like this:

<requestHandler name="/select" class="solr.SearchHandler">
  <!-- default values for query parameters can be specified, these
  will be overridden by parameters in the request
  -->
  <lst name="defaults">
    <str name="echoParams">explicit</str>
    <int name="rows">10</int>
  </lst>
</requestHandler>

Thank you to Sitecore support for suggesting some good troubleshooting steps. We used Fiddler to figure out that our requests were returning JSON.

I found the issue for my Solr problems. In my case the issue was in the Solrconfig, not Sitecore. The issue is that the default settings for the /select request somehow were changed to return JSON.

Our team has a templated set of Solr settings. Somehow those settings got edited incorrectly thus cause JSON to be returned when XML was the expected default.

Here's the configuration that caused the problem:

    <requestHandler name="/select" class="solr.SearchHandler">
      <!-- default values for query parameters can be specified, these
         will be overridden by parameters in the request
      -->
       <bool name="terms">true</bool> REMOVED
       <lst name="defaults">
         <str name="echoParams">explicit</str>
         <str name="wt">json</str> REMOVED
         <str name="indent">true</str> REMOVED
         <str name="df">text</str>
         <int name="rows">10</int>
         <bool name="terms">true</bool> REMOVED
       </lst>
       <arr name="last-components">  REMOVED ELEMENT
         <str>terms</str>
       </arr>
    </requestHandler>

Where the final configuration should have looked like this:

<requestHandler name="/select" class="solr.SearchHandler">
  <!-- default values for query parameters can be specified, these
  will be overridden by parameters in the request
  -->
  <lst name="defaults">
    <str name="echoParams">explicit</str>
    <int name="rows">10</int>
  </lst>
</requestHandler>

Thank you to Sitecore support for suggesting some good troubleshooting steps. We used Fiddler to figure out that our requests were returning JSON.

I found the issue for my Solr problems. In my case the issue was in the Solrconfig, not Sitecore. The issue is that the default settings for the /select request somehow were changed to return JSON.

Our team has a templated set of Solr settings. Somehow those settings got edited incorrectly thus cause JSON to be returned when XML was the expected default.

Here's the configuration that caused the problem:

<requestHandler name="/select" class="solr.SearchHandler">
  <!-- default values for query parameters can be specified, these
     will be overridden by parameters in the request
  -->
   <bool name="terms">true</bool> REMOVED
   <lst name="defaults">
     <str name="echoParams">explicit</str>
     <str name="wt">json</str> REMOVED
     <str name="indent">true</str> REMOVED
     <str name="df">text</str>
     <int name="rows">10</int>
     <bool name="terms">true</bool> REMOVED
   </lst>
   <arr name="last-components">  REMOVED ELEMENT
     <str>terms</str>
   </arr>
</requestHandler>

Where the final configuration should have looked like this:

<requestHandler name="/select" class="solr.SearchHandler">
  <!-- default values for query parameters can be specified, these
  will be overridden by parameters in the request
  -->
  <lst name="defaults">
    <str name="echoParams">explicit</str>
    <int name="rows">10</int>
  </lst>
</requestHandler>

Thank you to Sitecore support for suggesting some good troubleshooting steps. We used Fiddler to figure out that our requests were returning JSON.

Source Link
Derek Port
  • 143
  • 2
  • 10

I found the issue for my Solr problems. In my case the issue was in the Solrconfig, not Sitecore. The issue is that the default settings for the /select request somehow were changed to return JSON.

Our team has a templated set of Solr settings. Somehow those settings got edited incorrectly thus cause JSON to be returned when XML was the expected default.

Here's the configuration that caused the problem:

    <requestHandler name="/select" class="solr.SearchHandler">
      <!-- default values for query parameters can be specified, these
         will be overridden by parameters in the request
      -->
       <bool name="terms">true</bool> REMOVED
       <lst name="defaults">
         <str name="echoParams">explicit</str>
         <str name="wt">json</str> REMOVED
         <str name="indent">true</str> REMOVED
         <str name="df">text</str>
         <int name="rows">10</int>
         <bool name="terms">true</bool> REMOVED
       </lst>
       <arr name="last-components">  REMOVED ELEMENT
         <str>terms</str>
       </arr>
    </requestHandler>

Where the final configuration should have looked like this:

<requestHandler name="/select" class="solr.SearchHandler">
  <!-- default values for query parameters can be specified, these
  will be overridden by parameters in the request
  -->
  <lst name="defaults">
    <str name="echoParams">explicit</str>
    <int name="rows">10</int>
  </lst>
</requestHandler>

Thank you to Sitecore support for suggesting some good troubleshooting steps. We used Fiddler to figure out that our requests were returning JSON.