Troubleshooting Sitecore Solr Index

I’ve worked on various Sitecore implementations where the customer has often run into issues with data not being returned as expected the first thing I do now to troubleshoot is to check the Solr Index.

Check Solr Is Up

  1. If you are not sure of the address of your Solr instance you can locate the url in the following configuration file app_config/includes/Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config and the setting, for example: <setting name=”ContentSearch.Solr.ServiceBaseAddress” value=”https://localhost:8983/solr“></setting>
  2. Use Solr Ping to check the status of the master solr index http://localhost:8983/solr/sitecore_master_index/admin/ping?wt=json
  3. You should receive the following output with the status of OK:
    SolrPing

Check The Sitecore Logs

There are two Sitecore logs associated with Search that can help provide insight when you are experiencing issues with Solr:

  • The crawling.log file contains information about the indexing process and its operations.
  • The search.log file contains information about the search queries that Sitecore executes.
    So if you run your Sitecore instance and perform the functionality that isn’t returning data as expected you will see those queries written to this search.log. You’ll see lots of different requests being made to solr that look like: Solr Query – ?q=(_template:(1b93c428d8774a15a0f67dbc9be1b4ea) AND jdedivisionid_tl:(380))&rows=2147483642&fq=_indexname:(sitecore_master_index)

Attempt to Query the Solr Index directly

You can run queries against the solr index directly by:

  1. Access the solr instance
  2. Select the index it probably going to be Sitecore_Master_Index or the Sitecore_Web_Index or a custom application index.
  3. Once selected click the query link.
  4. You will notice the url in solr instance will change and display the selected index this help verify you have selected the correct index <instancename>/solr/#/sitecore_master_index/query</instancename>
  5. If you leave all the default query settings as they are and click the Execute Query button Solr will return the total number of documents in the index.solrexecutequery
  6. To execute your query from the Sitecore Search log copy the query from log basically everything after “?q=” and before “&rows”
    so using the example above : (_template:(1b93c428d8774a15a0f67dbc9be1b4ea) AND jdedivisionid_tl:(380))
  7. Paste this into the q field you can leave everything else as is and click Execute Query the results will be displayed.
  8. If the query was successful the response will contain a list of documents that match the query with a summary of the total number of documents contained in the results.
  9. If there are no documents matching the query then no documents are returned. You may need to rebuild the index.

Additional Info

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s