My new blog present here.

Featured Post

Insights into Sitecore Search: A Definitive Introduction

A key component of digital experience management is effective information retrieval. A simplified approach is required for websites, applications, and platforms containing a lot of material so that consumers can easily get the data they require. This need is met by Sitecore, a well-known name in the field of digital experience platforms (DXPs), which provides powerful and comprehensive search functionality. We will travel into the realm of Sitecore Search in this article, learning about its capabilities, architecture , and the enormous value it offers both developers and end users. Introduction to Sitecore Search    A headless content discovery platform powered by AI , Sitecore Search enables you to build predictive and custom search experiences across various content sources. To extract and index you

Sitecore Error Troubleshooting: Sitecore Solr Connectivity Issue:: Part-2


Sitecore 9.1 and Solr Connection issue in Sitecore Azure PaaS XP Single Topology or Sitecore on-premise XP Single

 Sitecore Solr connectivity issue:
• Part-1 : Sitecore Solr connectivity issue details with ways to check the connectivity
Part-2 : How to resolve Sitecore Solr connectivity in Sitecore XP Single Topology
Part-3 : How to resolve Sitecore Solr connectivity in Sitecore XP Scaled/Distributed Topology

The Sitecore Experience Platform providing the capability to select search provider as Solr, Lucene or Azure Search:
For on-premise, Solr configured as Default search engine provider for content search and xConnect search.
For Sitecore Azure PaaS instance, Microsoft Azure search configured as Default search engine. You can change search service provider from default Microsoft Azure search to Solr.

In this blog post, we will learn how to validate the Solr configuration in Sitecore Azure PaaS XP Single Topology or Sitecore on-premise XP Single environment

Problem Statement:
After setting up the new Sitecore 9 environment (IaaS or PaaS or On-Prem), Sitecore not able to connect with the Solr:
Sitecore Solr Indexes were not loading.
Sitecore Cores not created in the Solr instance while creating the new Sitecore 9 environment.

Above issue details mentioned in my previous blog post Sitecore Error Troubleshooting: Sitecore Solr Connectivity Issue:: Part-1

The Solr url https://12.832.11.201:8983/solr accessible via browser and its using Self-Signed certificates. In PROD instance, it will be using the valid certificates and for Sitecore PaaS instance’s in CM and CD app service needs Solr certificate Thumbprint needs to be installed to establish the handshake from any client for authorization. From Azure we can install the pfx certificate and thumbprint to establish the connection between Sitecore to SOLR.

Proposed Solution:
I would like to thank DAVID RUCKMAN (@druckman), for sharing knowledge on “Switch Sitecore 9 From Azure Search to Solr -- Step-By-Step Instructions”, this article helps in identifying the Sitecore Solr connectivity issue.

By following “Switch Sitecore 9 From Azure Search to Solr -- Step-By-Step Instructions”, I tried changing the configuration one-by-one and come up with set of configurations which needs to be changed to make connectivity between Sitecore and Solr.

Change the Sitecore configuration in CM or CM App Service:
1. Go to the [WebRoot]\Web.config:
  • Remove the <add key="search:define" value="<Azure or Lucene>" /> and add <add key="search:define" value="Solr" /> 
2. Open [WebRoot]\App_Config\Sitecore\ContentSearch\Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config:
  • REMOVE or COMMENT below entries:
    • <setting name="ContentSearch.Solr.ServiceBaseAddress" value="https://<URL TO YOUR SOLR INSTANCE>:<PORT NUMBER>/solr" />
    • <setting name="ContentSearch.SearchMaxResults" value="500" />
3. Go to [WebRoot]\App_Config\ConnectionStrings.config:
        I. Search for "solr.search" and update the Solr url with Master Solr Url: -
               <add name="solr.search" connectionString="< URL TO YOUR SOLR INSTANCE>:<PORT NUMBER>/solr" />
       II. Search for "cloud.search",  it SHOULD BE EMPTY or COMMENTED :
<add name="cloud.search" connectionString="" />
       III. Remove the  “<add name="collection.search" ... />”

Change the Sitecore configuration in xConnect or xConnect App Service:
1. Disable file [WebRoot]\App_data\config\sitecore\CollectionSearch\sc.Xdb.Collection.IndexReader.AzureSearch.xml 
2. Enable file [WebRoot]\App_data\config\sitecore\CollectionSearch\sc.Xdb.Collection.IndexReader.SOLR.xml
3. Disable file [WebRoot]\App_data\config\sitecore\SearchIndexer\sc.Xdb.Collection.IndexWriter.AzureSearch.xml 4. Enable file [WebRoot]\App_data\config\sitecore\SearchIndexer\sc.Xdb.Collection.IndexWriter.SOLR.xml
5. Disable file [WebRoot]\App_data\jobs\continuous\IndexWorker\App_data\Config\Sitecore\CollectionSearch\sc.Xdb.Collection.IndexReader.AzureSearch.xml
6. Enable file [WebRoot]\App_data\jobs\continuous\IndexWorker\App_data\Config\Sitecore\CollectionSearch\sc.Xdb.Collection.IndexReader.SOLR.xml
7. Enable file [WebRoot]\App_data\jobs\continuous\IndexWorker\App_data\Config\Sitecore\CollectionSearch\sc.Xdb.Collection.WebClient.SOLR.xml
8. Disable file [WebRoot]\App_data\jobs\continuous\IndexWorker\App_data\Config\Sitecore\SearchIndexer\sc.Xdb.Collection.IndexWriter.AzureSearch.xml
9. Enable file [WebRoot]\App_data\jobs\continuous\IndexWorker\App_data\Config\Sitecore\SearchIndexer\sc.Xdb.Collection.IndexWriter.SOLR.xml
10. Update the file [WebRoot]\App_Config\ConnectionStrings.config : 
      I. Remove the  “<add name="collection.search" ... />”
      II. Add <add name="solrCore" connectionString="< URL TO YOUR SOLR INSTANCE>:<PORT NUMBER>/solr/xdb" />
11. Upddate the file [WebRoot]\App_data\jobs\continuous\IndexWorker\App_config\ConnectionStrings.config: - 
       I. Remove the  “<add name="collection.search" ... />”
       II. Add <add name="solrCore" connectionString="< URL TO YOUR SOLR INSTANCE>:<PORT NUMBER>/solr/xdb" />

After performing configuration changes:
Restart the Sitecore instances or Sitecore Azure App Services.
Login into Sitecore instance and access the itecore Launch Pad >  Control Panel > Indexing > Indexing Manager and verify that Solr indexes are loading or not.
If Solr indexes are loading then re-build all the indexes and check count of documents (numDocs) in each Sitecore Solr core at Solr instance.

Note:- 
1.Please update file name .disabled at the end to disable the files
2.remove .disabled from the file name to enable the file

Issue Listing:
Sitecore 9.1 (IaaS and Azure PaaS) + Solr (IaaS) Connectivity
Sitecore Solr Connections
Sitecore Solr Configurations
Setting up Solr with Sitecore
Configure Sitecore to work with Solr
Provisioning Sitecore environment using Solr connection
Sitecore Solr Index Issues
Switch Search Provider in Sitecore

Comments

Popular posts from this blog

Sitecore GraphQL Queries

Configuring Sitecore Next.js Headless SXA Multisite App in a Sitecore Container

Sitecore Experience Manager Cloud (XM Cloud) Building blocks