Walkthrough: Configure Azure Cognitive Search

Current version: 9.3

Azure Cognitive Search will be discontinued in the future and Sitecore will no longer provide support for this service in future releases.

To use Azure Search with Sitecore you must first configure your Azure Search service with your Sitecore instance. 

Format the connection string

The default connection string name for Cloud Search is cloud.search and it contains the following information:

  • serviceUrl – the HTTPS URL of the search service API (for example, https://dk-test.search.windows.net).

  • apiVersion – follows a date format, for example, 2017-11-11 (see more information on API versions).

  • apiKey – the admin key to the service that you obtain from the Azure management portal.


For Sitecore version 9.1 and later, set the API version to 2017-11-11. For information about other supported versions, refer to the Azure Search compatibility table.

The connection string format is:

<add name="cloud.search" connectionString="serviceUrl=<url>;apiVersion=<apiVersion>;apiKey=<apiKey>" /> 

Azure Cognitive Search for xConnect does not support this feature.

Geo-replicated scenarios

Sitecore supports a Search service with geo-replicated scenarios. To use this type of scenario:

  1. Create two or more Search service instances.

  2. Add connection strings with a pipe separator (|). If you have two search services, for example, searchservice1 and searchservice2, and you want to use them in a geo-replicated scenario, you must use the following connection string:

    <add name="cloud.search" 
    connectionString="serviceUrl=https://searchservice1.search.windows.net;apiVersion=2015-02-28;apiKey=AdminKey1|serviceUrl=https://searchservice2.search.windows.net;apiVersion=2015-02-28;apiKey=AdminKey2" /> 

Advanced scaling scenarios

For advanced scaling scenarios, it is best practice to use a dedicated search service for your index. To set this up:

  1. Add a new connection string (for example, cloud.search.analytics).

  2. Configure the corresponding index with this connection string name:

Connection string name

Specify Azure as your search provider

By default Sitecore is distributed with the Solr search provider enabled. 

In order to use Azure instead, you must specify Azure as your search provider in the web.config file.

Rebuild the indexes

You must rebuild the indexes to ensure Sitecore is fully operational.

To rebuild the indexes:

  1. Go to the Sitecore login page (http:// {your_instance}/sitecore/login) and log in with your admin credentials.

  2. On the Sitecore Launchpad, click Control Panel, and select Indexing manager.

  3. To select and rebuild all of the indexes, on the Indexing Manager page, click Select all, Rebuild.


    Rebuilding the index is a time consuming operation and can take 15 minutes or more.

    When the indexes are rebuilt, the Sitecore search indexes appear in the Search service window of the Azure Portal.

    Indexing Manager page

Map the Azure field types

Azure Search uses the following Entity Data Model (EDM) field types. Refer to the table to ensure you map the field types correctly.

Field type



Optional: Text that can be tokenized for full-text search, for example, word-breaking, stemming, and so on.


A list of strings that can be tokenized for full-text search. There is no upper limit on the number of items in a collection, but remember that the 16 MB upper limit on payload size applies to collections.


Contains true or false values.


Contains 32-bit integer values.


Contains 64-bit integer values.


Uses double-precision numeric data.


The date and time values are represented in the OData V4 format, for example:




The precision of DateTime fields is limited to milliseconds. If you upload DateTime values that have sub-millisecond precision, the returned value will be rounded up to milliseconds, for example:

2015-04-15T10:30:09.7552052Z will be returned as:


To see how to define the different types of mapping between .Net and Sitecore, go to the sitecore\contentsearch\indexConfigurations\defaultCloudIndexConfiguration\CloudTypeMapper node in the App_Config\Sitecore\ContentSearch.Azure\Sitecore.ContentSearch.Azure.DefaultIndexConfiguration.config file.


You must define the map element for all custom fields like this:

<map type="<Field type>" cloudType="<Edm type from list of supported types>" />

Map fields

When listing all of the fields that the components use under the index configuration section, it is best practice that you list them as follows:

  • sitecore\contentSearch\configuration\indexes\index\configuration\fieldMap

The supported attributes are:




Use the boost attribute to give one field more importance than another.


Use this attribute to set up an analyzer for both search and indexing operations.


If you are using the searchAnalyzer and indexAnalyzer attributes, you must specify them as a pair that replace the single cloudAnalyzer attribute.


The field name as defined for Cloud. It can only contain letters, numbers, and underscores.


The first character must be a letter.


The name of the field, as defined for Solr.


You must configure this attribute for DateTime type fields. The supported value is yyyy-MM-ddTHH:mm:ss.fffZ.


Use this attribute to set up an analyzer for indexing operations.


If you use this attribute, you must specify the searchAnalyzer and indexAnalyzer attributes as a pair that replace the single cloudAnalyzer attribute.


Use this attribute to set up an analyzer for search operations.


If you use this attribute, you must specify the searchAnalyzer and indexAnalyzer attributes as a pair that replace the single cloudAnalyzer attribute.


The settingType property must be: Sitecore.ContentSearch.Azure.CloudSearchFieldConfiguration, Sitecore.ContentSearch.Azure

Use the support reference for Azure Search to ensure that you configure query support and facet support correctly.

Configure a number of open HTTP connections

You can manage the number of connections that the Azure Search provider uses with the following setting:

<setting name="ContentSearch.Azure.ServicePoint.ConnectionLimit" value="100" />

In the following scenarios you must adjust the setting value:

  • Decrease the value - If there are other applications that are using HTTP intensively.

  • Increase the value - If an application is under a high load, it takes too long to create new connections or creation fails. This is due to the exceed limit being set too low.

Configure the Token Analyzer

The token Analyzer divides text into tokens by adding support from the Azure Search Analyzer API. If a search query contains non-Latin characters such as a hyphen ("-") , it separates the text into two tokens. For example, if you search in the Name field with the query test-index, the text in the query is tokenized into two separate tokens: test and index (regardless of whether the field contains any language analyzers).

Query results depend on which analyzer is configured. If a field does not contain any analyzers, the ContentSearch.Azure.DefaultTokenAnalyzer will be used to send requests.

Use the following settings to configure analyzers:




Controls whether to send a request to analyze the API. This setting can influence the performance of your environment. However, you can disable it. If the setting is disabled, or a response from Analyze API returns errors, then the text will be divided on tokens that include the following symbols:

" " (space)




















Use this to specify the default analyzer that will send requests to analyze API. By default, requests are sent using the standard Lucene analyzer, unless you specify otherwise.


Controls how long items can stay in cache. This is important because all Analyze API requests influence the performance of your environment to store the results of Analyze API in cache.

Control fields with whitelisting

You use whitelisting to control which fields are included in the index schema.

To configure Azure Search whitelisting:

  1. In the \App_Config\Sitecore\ContentSearch.Azure\ Sitecore.ContentSearch.Azure.DefaultIndexConfiguration.config  configuration file, set the value of the indexAllFields setting  to false.

  2. In the configuration file, add the minimal recommended fields to include to list in the configuration section. The minimal recommended list of fields includes:

    <include hint="list:AddIncludedField">
  3. Extend the configuration section with the fields you want to index.

Do you have some feedback for us?

If you have suggestions for improving this article,