Sitecore Upgrades Mixed with Solr

Monday, March 21, 2016

Sitecore Upgrades Mixed with Solr

By: Scott Gillis, Lead Consultant – I've recently seen an uptick in Sitecore upgrades that have implemented Solr as their search provider. Most of these upgrades are coming from a version of 7.x moving to the latest 8.x version. This posts enumerates a few of the differences you need to be aware of as you move through the upgrade process when dealing with Solr. Since my upgrades, as of late, have not been moving from 6.x into anything, I won't be listing helpful advice regarding practices for rewriting all of your search code, which would be required.

Updated Assemblies

  1. Assemblies are updated not from the Sitecore update package, but are copied in from a Sitecore Solr Support archive that must be downloaded separately from the main update package and files
  2. In most instances, the date stamp on these Solr Support archives are within a day, plus or minus, of the release date stamp on the Sitecore version
  3. Starting with 7.0 Initial (IR), the only Solr related assemblies you should have are
    1. AutofacContrib.SolrNet.dll
    2. Castle.Facilities.SolrNetIntegration.dll
    3. Microsoft.Practices.ServiceLocation.dll
    4. Ninject.Integration.SolrNet.dll
    5. Sitecore.ContentSearch.Linq.Solr.dll
    6. Sitecore.ContentSearch.SolrProvider.AutoFacIntegration.dll
    7. Sitecore.ContentSearch.SolrProvider.CastleWindsorIntegration.dll
    8. Sitecore.ContentSearch.SolrProvider.dll
    9. Sitecore.ContentSearch.SolrProvider.NinjectIntegration.dll
    10. Sitecore.ContentSearch.SolrProvider.StructureMapIntegration.dll
    11. Sitecore.ContentSearch.SolrProvider.UnityIntegration.dll
    12. SolrNet.dll
    13. StructureMap.SolrNetIntegration.dll
    14. Unity.SolrNetIntegration.dll

Configuration File Renamed

Another major change is the renaming and addition of new Solr related configuration files. In my upgrades, this caused the most headaches for us, as there was a naming convention change that wasn't fully documented that caused our instances to try and incorrectly load types.

  1. Solr configuration files are included in the Solr Support packages for 7.0, 7.1, 7.2 and 7.5. Starting with 8.0, the configuration files are included as the part of the base Sitecore install
  2. The following table shows the different configuration files you will need to manage and be aware of as you move through your upgrade process
    • When moving into Sitecore 8.0 or 8.1, you will need to manually delete 'Sitecore.ContentSearch.Solr.Indexes.config'
    • Depending on the instructions followed for configuring individual indexes, you may need to delete or compare to the new indexing configuration files in Sitecore 8.0 and Sitecore 8.1
  3. If you have custom indexes defined, you will need to update the configuration type, as this has changed namespaces starting in Sitecore 7.2 IR
    • Pre 7.2 is
      <configuration type="Sitecore.ContentSearch.SolrProvider.SolrSearchConfiguration, Sitecore.ContentSearch.SolrProvider">
    • Post 7.2 is
      <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
Sitecore 7.0 IR+
Sitecore 7.1 IR+
Sitecore 7.2 IR+
Sitecore 7.5 IR+ Sitecore 8.0 IR+
Sitecore 8.1 IR+
Sitecore.ContentSearch.config Sitecore.ContentSearch.config Sitecore.ContentSearch.config
Sitecore.ContentSearch.VerboseLogging.config Sitecore.ContentSearch.VerboseLogging.config Sitecore.ContentSearch.VerboseLogging.config
Sitecore.ContentSearch.Solr.Indexes.config Sitecore.ContentSearch.Solr.Indexes.config ----Delete for this Version----
-----Does Not Apply----- Sitecore.ContentSearch.Solr.Indexes.Analytics.config ----Name Change Occurs-----
----Delete for this Version----
-----Does Not Apply----- Sitecore.ContentSearch.Analytics.config Sitecore.ContentSearch.Analytics.config
-----Does Not Apply----- Sitecore.ContentSearch.DefaultConfigurations.config Sitecore.ContentSearch.DefaultConfigurations.config
-----Does Not Apply----- -----Does Not Apply----- Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config
-----Does Not Apply----- -----Does Not Apply----- Sitecore.ContentSearch.Solr.Index.Analytics.config
-----Does Not Apply----- -----Does Not Apply----- Sitecore.ContentSearch.Solr.Index.Core.config
-----Does Not Apply----- -----Does Not Apply----- Sitecore.ContentSearch.Solr.Index.Master.config
-----Does Not Apply----- -----Does Not Apply----- Sitecore.ContentSearch.Solr.Index.Web.config
-----Does Not Apply----- -----Does Not Apply----- Sitecore.ContentTesting.Solr.IndexConfiguration.config
-----Does Not Apply----- -----Does Not Apply----- Sitecore.FXM.Solr.Index.DomainsSearch.config
-----Does Not Apply----- -----Does Not Apply----- Sitecore.ListManagement.Solr.Index.List.config
-----Does Not Apply----- -----Does Not Apply----- Sitecore.ListManagement.Solr.IndexConfiguration.config
-----Does Not Apply----- -----Does Not Apply----- Sitecore.Social.Solr.Index.Master.config
-----Does Not Apply----- -----Does Not Apply----- Sitecore.Social.Solr.Index.Web.config
-----Does Not Apply----- -----Does Not Apply----- Sitecore.Social.Solr.IndexConfiguration.config
-----Does Not Apply----- -----Does Not Apply----- Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.Index.Master.config
-----Does Not Apply----- -----Does Not Apply----- Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.Index.Web.config
-----Does Not Apply----- -----Does Not Apply----- Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.IndexConfiguration.config

Added Cores

  1. Most tutorials for configuring Sitecore for Solr have you generate a single core in Solr. Normally this core is called 'itembuckets', and the same core is configured for Web, Master and Core indexes
  2. Sitecore 7.5 introduces a new index 'sitecore_solr_analytics_index' that also configured to use a core named 'itembuckets'
  3. Starting with Sitecore 8.0 Initial Release two things happens
    • First, Sitecore stops defaulting to 'itembuckets' for the core name and now uses the index's name via the $(id) token
      • sitecore_marketing_asset_index_web
      • sitecore_marketing_asset_index_master
      • social_messages_web
      • social_messages_master
      • sitecore_list_index
      • sitecore_fxm_master_index
      • sitecore_fxm_web_index
      • sitecore_suggested_test_index
      • sitecore_testing_index
      • sitecore_analytics_index
      • sitecore_core_index
      • sitecore_web_index
      • sitecore_master_index
  4. If the above cores do not exist and you try to login to Sitecore after upgrading to 8.0, you may be faced with the following unhelpful error message:
    Connection error to search provider [Solr] : Unable to connect to [ http://localhost:8983/solr]
  5. To solve this, you either need to create all of the cores listed above or trick Sitecore into using your single existing 'itembuckets' core via the following helpful patch file. Be sure to place this Instead use the following patch file to be placed into your 'z.loadlast' directory in App_Config \ Include. ["The z.what the hell directory?" you ask, take a look at my post How Sitecore Config Files Load.]
  6. The patch file can also be used if you wish to set up a different naming schema without having to touch each base configuration file post upgrade

Schema XML

If part of your upgrade process is to also upgrade to the latest version of Solr or if you are running a version of Solr 4.8 or later, you may experience the following error message:


There is a known issue with the Sitecore schema generator where it cannot properly update the base schema file for these versions. Therefore, after running the schema generator, there are some manual steps that must be taken as documented in the following Sitecore Knowledge Base article

As always, feel free to tweet me questions or comments @thecodeattic or on Sitecore Slack Community as @gillissm.