Hi Folks,

In my previous blog post Configure Solr with Sitecore : Part 2 – Making Solr ready to connect with Sitecore, We saw how to create SOLR cores. Now In this post we will configure Sitecore to connect with Solr service.

  1.  We will disable following Lucene specific files by adding .example or .disable into the filename.
    1. Location : /website/App_Config/Include
      1. Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config
      2. Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.Xdb.config
      3. Sitecore.ContentSearch.Lucene.Index.Analytics.config
      4. Sitecore.ContentSearch.Lucene.Index.Core.config
      5. Sitecore.ContentSearch.Lucene.Index.Master.config
      6. Sitecore.ContentSearch.Lucene.Index.Web.config
      7. Sitecore.ContentSearch.Lucene.Indexes.Sharded.Core.config
      8. Sitecore.ContentSearch.Lucene.Indexes.Sharded.Master.config
      9. Sitecore.ContentSearch.Lucene.Indexes.Sharded.Web.config
      10. Sitecore.Speak.ContentSearch.Lucene.config
      11. Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Lucene.Index.Master.config
      12. Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Lucene.Index.Web.config
      13. Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Lucene.IndexConfiguration.config
      14. Sitecore.Marketing.Lucene.Index.Master.config
      15. Sitecore.Marketing.Lucene.Index.Web.config
      16. Sitecore.Marketing.Lucene.IndexConfiguration.config
    2. Location: /website/App_Config/Include/Social
      1. Sitecore.Social.Lucene.IndexConfiguration.config
      2. Sitecore.Social.Lucene.Index.Analytics.Facebook.config
      3. Sitecore.Social.Lucene.Index.Master.config
      4. Sitecore.Social.Lucene.Index.Web.config
    3. Location: /website/App_Config/Include/ListManagement
      1. Sitecore.ListManagement.Lucene.Index.List.config
      2. Sitecore.ListManagement.Lucene.IndexConfiguration.config
    4. Location: /website/App_Config/Include/FXM
      1. Sitecore.FXM.Lucene.DomainsSearch.DefaultIndexConfiguration.config
      2. Sitecore.FXM.Lucene.DomainsSearch.Index.Master.config
      3. Sitecore.FXM.Lucene.DomainsSearch.Index.Web.config
    5. Location: /website/App_Config/Include/ContentTesting
      1. Sitecore.ContentTesting.Lucene.IndexConfiguration.config
  2. we will enable following Solr specific files by removing .example or .disabled from the file name.
    1. Location: /website/App_Config/Include/Include 
      1. Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config.example
      2. Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.Xdb.config.example
      3. Sitecore.ContentSearch.Solr.Index.Analytics.config.example
      4. Sitecore.ContentSearch.Solr.Index.Core.config.example
      5. Sitecore.ContentSearch.Solr.Index.Master.config.example
      6. Sitecore.ContentSearch.Solr.Index.Web.config.example
      7. Sitecore.Speak.ContentSearch.Solr.config.example
      8. Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.Index.Master.config.disabled
      9. Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.Index.Web.config.disabled
      10. Sitecore.Marketing.Definitions.MarketingAssets.Repositories.Solr.IndexConfiguration.config.disabled
      11. Sitecore.Marketing.Solr.Index.Master.config.example
      12. Sitecore.Marketing.Solr.Index.Web.config.disabled
      13. Sitecore.Marketing.Solr.IndexConfiguration.config.disabled
    2. Location: /website/App_Config/Include/FXM
      1. Sitecore.FXM.Solr.DomainsSearch.DefaultIndexConfiguration.config.disabled
      2. Sitecore.FXM.Solr.DomainsSearch.Index.Master.config.disabled
      3. Sitecore.FXM.Solr.DomainsSearch.Index.Web.config.disabled
    3. Location: /website/App_Config/Include/ContentTesting
      1. Sitecore.ContentTesting.Solr.IndexConfiguration.config.example
    4. Location: /website/App_Config/Include/ListManagement
      1. Sitecore.ListManagement.Solr.Index.List.config.disabled
      2. Sitecore.ListManagement.Solr.IndexConfiguration.config.disabled
    5. Location: /website/App_Config/Include/Social
      1. Sitecore.Social.Solr.IndexConfiguration.config.disabled
      2. Sitecore.Social.Solr.Index.Web.config.disabled
      3. Sitecore.Social.Solr.Index.Master.config.disabled
  3. We have to update ServiceBaseAddress  in Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config file. Instead of updating sitecore config file, we will create a patch file and add this into our solution.
      
    
     <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    
     <sitecore>
    
     <settings>
    
     <setting name="ContentSearch.Solr.ServiceBaseAddress">
    
     <patch:attribute name="value">http://127.0.0.1:8022/solr </patch:attribute >
    
     </setting>
    
     </settings>
    
     </sitecore>
    
     </configuration>
    
     
  4. If we have already setup DI in our project, Download Solr Support Package (It is for Sitecore 8.2 rev. 160729). It is available in Additional Tools section.
    1. Copy necessary .dll files into the /bin folder as per our IOC configuration. Follow the steps from Sitecore Article.
    2. If we are using Sitecore Version 8.0 or 8.1 then we have to update Global.asax file as per the Sitecore Article.
    3. If we are using Sitecore Version 8.2 then not require to update global.asax file but instead of that we will add .config file into the solution. The .config file is available in  Solr Support Package.
  5. Now, let's start our Sitecore Instance. Go to the Control Panel and click on Indexing Manager. Rebuild all the indexes.Step 23.png

With this, all the steps for configuring Sitecore to work with Solr are complete. After the Sitecore indexes are successfully rebuilt, we will be able to use data from the Solr indexes.

Previous posts in series:
Part 2  Configure Solr with Sitecore : Part 2 – Making Solr ready to connect with Sitecore
Part 1  Configure Solr with Sitecore: Part 1 – Install Solr as a Windows Service