Published Date: 17 October, 2020

Search is a major functionality for any of the websites and performance of the website majorly depends on the search performance. Officially Sitecore support three different search engines: SOLR, Azure Search and Lucene. Sitecore does not recommend using Lucene as it would be deprecated in later Sitecore releases. Even Sitecore does not support Lucene for the production environment.

Solr is the default search engine for the on premise environment and Azure Search is the default search engine for Microsoft Azure PaaS.

Scope of this article/blog is to share the procedure to configure Azure Search. So, let's focus on this.

There are two steps pressure to use Azure Search with Sitecore.

Setup Azure Search on Azure

On Azure portal, go to the More Services and search Search Service.

http://www.tekkishare.com

Click on Add button to add Azure Search service. It would open the below form.

http://www.tekkishare.com

First you should be selecting Subscription. You can see all the available subscription account in the Subscription drop down.

Either you can create a new Resource Group or you can select the existing Resource Group.

Provide the Azure Search Url. It should be unique across the globe. Keep the mentioned URL for configuring Sitecore.

Select the location and pricing tier as per your requirement. For Sitecore, we should be having at least Standard as Sitecore has 15 indexes.

At the end click on Review + Create button to create Azure Search service.

Click on Keys on the left navigation to copy the primary admin key. Admin key would be used to configure with Sitecore.

http://www.tekkishare.com

Now you are ready from the Azure Search setup prospective. The next step is to configure our Sitecore instance to use Azure Search.

Configure Azure Search in Sitecore Instance

First you need to change to Azure Search from Solr as a search engine. Inside the web.config file, change Solr to Azure.

<add key="search:define" value="Azure" />

Second thing is to add the connection string for Azure search in the below format:

<add name="cloud.search" connectionString="serviceUrl=https://.search.windows.net;apiVersion=2017-11-11;apiKey=XXXXXXXXXXXXXX" />

Now your Sitecore configuration is completed.

Rebuild the indexes

Login into Sitecore and Click on Control Panel

http://www.tekkishare.com

If you have noticed, Populate Solr Managed Schema is absent. This option won't available with Azure Search.

Click on the indexing Manager and select all indexes available and click on Rebuild button. It would automatically create indexes if not available on Azure Search.

After successful indexes rebuild, you can see the indexes in the search services on Azure portal.

http://www.tekkishare.com

Solr Search Vs Azure Search

Generally Sitecore instance available on IAAS or on-premise uses Solr Search and Sitecore instance available on PaaS uses Azure Search. But this is not a rule. We can use any of these two search engine in any cases. But Sitecore recommend this infrastructure combination.

LicenseAzure Search is for commercial uses only whereas Solr is open source and free.
Supported Programming LanguageAzure Search supports C# and .Net as a programming language. Since Solr is an open source, it supports all major technology like .Net, Java, JavaScript, PHP, Perl, Python, Ruby, etc.
Primary classifiedAzure is a Search as a Service and Solr is a Search Engine
Fields limitAzure search can have up to 3000 fields. There is no such limit with Solr.
Joining queriesAzure search does not support .GroupJoin() or .SelfJoin() and other Join operators.



References: