Tuesday, 15 November 2016

Part 3: Sitecore 8.2 with SOLR 6.2

Leave a Comment
Hello, Sitecore enthusiasts! This is the third article of Sitecore 8.2 with Solr 6.2 blog series.

Configuring Sitecore to work with our Solr instance

With Sitecore 8.2, search and indexing no longer require a third-party DI container to enable Solr and there is no need to install a Solr support package. 

Disable Lucene Config File

Make sure all Lucene search related configuration files are disabled and Solr search configuration files are enabled. Follow below steps to switch configuration files so that Solr is enabled and Lucene is disabled: 
  1. Navigate to the website Include folder: \Website\App_Config\Include\ and disable the following Lucene configuration files by adding .disabled to the file name extension:
    • Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config
    • Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.Xdb.config
    • Sitecore.ContentSearch.Lucene.Index.Analytics.config
    • Sitecore.ContentSearch.Lucene.Index.Core.config
    • Sitecore.ContentSearch.Lucene.Index.Master.config
    • Sitecore.ContentSearch.Lucene.Index.Web.config
    • Sitecore.ContentSearch.Lucene.Indexes.Sharded.Core.config
    • Sitecore.ContentSearch.Lucene.Indexes.Sharded.Master.config
    • Sitecore.ContentSearch.Lucene.Indexes.Sharded.Web.config
    • Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Lucene.Index.Master.config
    • Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Lucene.Index.Web.config
    • Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Lucene.IndexConfiguration.config
    • Sitecore.Marketing.Lucene.Index.Master.config
    • Sitecore.Marketing.Lucene.Index.Web.config
    • Sitecore.Marketing.Lucene.IndexConfiguration.config
    • Sitecore.Speak.ContentSearch.Lucene.config
  2. Navigate to \Website\App_Config\Include\FXM and disable the following Lucene configuration files by adding .disabled to the file name extension:
    • Sitecore.FXM.Lucene.DomainsSearch.DefaultIndexConfiguration.config
    • Sitecore.FXM.Lucene.DomainsSearch.Index.Master.config
    • Sitecore.FXM.Lucene.DomainsSearch.Index.Web.config
  3. Navigate to \Website\App_Config\Include\ListManagement and disable the following Lucene configuration files by adding .disabled to the file name extension:
    • Sitecore.ListManagement.Lucene.Index.List.config
    • Sitecore.ListManagement.Lucene.IndexConfiguration.config
  4. Navigate to \Website\App_Config\Include\Social and disable the following Lucene configuration files by adding .disabled to the file name extension:
    • Sitecore.Social.Lucene.Index.Analytics.Facebook.config
    • Sitecore.Social.Lucene.Index.Master.config
    • Sitecore.Social.Lucene.Index.Web.config
    • Sitecore.Social.Lucene.IndexConfiguration.config
  5. Navigate to \Website\App_Config\Include\ContentTesting and disable the following Lucene configuration files by adding .disabled to the file name extension:
    • Sitecore.ContentTesting.Lucene.IndexConfiguration.config

Enable Solr Config File

  1. Enable the Sitecore.ContentSearch.Solr.*.config files by removing .example/.disabled from the file name. Configuration file extension should be .config.
    • Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config
    • Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.Xdb.config
    • Sitecore.ContentSearch.Solr.Index.Analytics.config
    • Sitecore.ContentSearch.Solr.Index.Core.config
    • Sitecore.ContentSearch.Solr.Index.Master.config
    • Sitecore.ContentSearch.Solr.Index.Web.config
    • Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.Index.Master.config
    • Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.Index.Web.config
    • Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.IndexConfiguration.config
    • Sitecore.Marketing.Solr.Index.Master.config
    • Sitecore.Marketing.Solr.Index.Web.config
    • Sitecore.Marketing.Solr.IndexConfiguration.config
    • Sitecore.Speak.ContentSearch.Solr.config
  2. Navigate to \Website\App_Config\Include\FXM and enable below configuration files by removing .example/.disabled from the file name:
    • Sitecore.FXM.Solr.DomainsSearch.DefaultIndexConfiguration.config
    • Sitecore.FXM.Solr.DomainsSearch.Index.Master.config
    • Sitecore.FXM.Solr.DomainsSearch.Index.Web.config
  3. Navigate to \Website\App_Config\Include\ListManagement and enable below configuration files by removing .example/.disabled from the file name:
    • Sitecore.ListManagement.Solr.Index.List.config
    • Sitecore.ListManagement.Solr.IndexConfiguration.config
  4. Navigate to \Website\App_Config\Include\Social and and enable below configuration files by removing .example/.disabled from the file name:
    • Sitecore.Social.Solr.Index.Master.config
    • Sitecore.Social.Solr.Index.Web.config
    • Sitecore.Social.Solr.IndexConfiguration.config
  5. Navigate to \Website\App_Config\Include\ContentTesting and and enable below configuration files by removing .example/.disabled from the file name:
    • Sitecore.ContentTesting.Solr.IndexConfiguration.config

Configure Solr specific settings in configuration file:

Open Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config file and update below settings:
  1. Specifying a Solr Service Address: This is the base url of Solr server. Update this accordingly.
  2. <setting name="ContentSearch.Solr.ServiceBaseAddress" value="http://localhost:8090/solr" />
  3. Enabling a Search Provider: This setting tells that which provider is currently being used. Enable the Solr as below:
  4. <setting name="ContentSearch.Provider" value="Solr" />

Rebuild search index

Perform below steps to rebuild the Sitecore search indexes:
  1. In the Control Panel, and click Indexing manager.
  2. Click Select all, and then click Rebuild.
  3. Indexes should be rebuilt without error.
That's it! Sitecore and Solr are configured now. In upcoming blog posts, I'll cover few common search techniques or functionalities using Solr as search provider. Comments and suggestions are most welcome. Happy coding!

0 comments :

Post a Comment