Sitecore Commerce and Solr -- How to Integrate Apache Solr with Sitecore Commerce 9.3 using SearchStax


SearchStax® can be used to enable Apache Solr on a Sitecore Commerce website.

Sitecore Commerce using SearchStax must be installed on top of an already existing Sitecore (XP) installation. Please see our guide on installing Sitecore 9.3.


  1. Download and Prep
  2. Prepare the Install Script
  3. Install Sitecore Commerce
  4. Configure Solr
  5. Configure Sitecore Commerce

Download and Prep

Sitecore Commerce requires that the following packages to be downloaded and extracted before starting the installation:


Download the msi file and follow the prompts for installation.

Package Name URL
Redis on Windows 3.2

Sitecore Commerce 9.3

Download the following package:

Package Name URL
Packages for On-Premises2020.01-5.0.145
  1. Create a C:\deploy directory.
  2. Extract the contents of the downloaded package into C:\deploy.
  3. Navigate to C:\deploy, and extract the following packages:

Sitecore PowerShell Extension 5.0 for Sitecore 9.3

Download the following package:

Package Name URL
Sitecore PowerShell Extension for Sitecore 9.3

Copy the downloaded content into C:\deploy.

Sitecore Experience Accelerator for 9.3

Download the following package:

Package Name URL
Sitecore Experience Accelerator for 9.3

Copy the downloaded content into C:\deploy.

MSBuild Microsoft Visual Studio Web targets

  1. Create a project in Visual Studio.

    1. Create a new project, ASP.NET Web Application (.NET Framework) C#
      SearchStax Sitecore Commerce
    2. Select Empty project, and then check the box for MVC, click create.
      SearchStax Sitecore Commerce

  2. Tools > NuGet Package Manager > Package Manager Console

  3. Execute the following command:
    Install-Package MSBuild.Microsoft.VisualStudio.Web.targets -Version
  4. Open File Explorer and navigate to the root directory of the blank project.
  5. Navigate to packages.
  6. Copy the folder MSBuild.Microsoft.VisualStudio.Web.targets.
  7. Paste it to C:\deploy.
  8. Make a note of the location of Microsoft.Web.XmlTransform.dll. Usually it will be at C:\deploy\MSBuild.Microsoft.VisualStudio.Web.targets.\tools\VSToolsPath\Web\Microsoft.Web.XmlTransform.dll.

Create a Secret Client Certificate

  1. Open Powershell and execute the following commands:
        $bytes = New-Object Byte[] 32
        $rand = [System.Security.Cryptography.RandomNumberGenerator]::Create()
        $newClientSecret = [System.Convert]::ToBase64String($bytes)
        Write-Host $newClientSecret
  2. Make note of the value returned by the last command. It will be used in the install script.

Prepare the Install Script

The script is located at c:\deploy\\Deploy-Sitecore-Commerce.ps1.

Create a copy of the script and name it "MyDeploy-Sitecore-Commerce.ps1".

If you are installing this on an On-Premise Sitecore installation, then you must have specified a Prefix when installing Sitecore XP 9.3. If yes, then make the following changes:

Variable Value
[string]$SiteNamePrefix "sitecore930" (enter your prefix here)
[string]$SqlUser "sa"
[string]$SqlPass password
[string]$CommerceEngineConnectClientSecret Secret client certificate value

Comment out or remove these variables for Solr:

# SolrRoot                                    = "$($Env:SYSTEMDRIVE)\solr-8.1.1"
# SolrService                                 = "solr-8.1.1"

Remove the following lines as well:

254      SolrRoot                             = Resolve-ItemPath -Path $SolrRoot
255      SolrService                          = $SolrService

You must also set the following variables and values:

Variable Value

Go to C:\deploy\SIF.Sitecore.Commerce.4.0.31\Configuration\Commerce\Master_SingleServer.json and remove the following entry:

"Solr": {
            "Source": ".\\Configuration\\Commerce\\Solr\\Solr.Install.json"

Install Sitecore Commerce

  1. Open PowerShell v5 as an administrator.

  2. Navigate to C:\deploy\SIF.Sitecore.Commerce.3.0.28.

  3. Set the execution policy to bypass:
    Set-ExecutionPolicy Bypass

  4. Execute the script:

  5. Manually remove the following folder: C:\inetpub\wwwroot\$Prefix.SC\SiteUtilityPages

Configure Solr

Along with the collections that Sitecore XP uses by default, Sitecore Commerce expects Solr to have additional collections, each with an appropriate config directory.

Create Configs

  1. Use the SearchStax Client (zkcli) to download the existing _default config from Zookeeper. ./ -zkhost <zookeeper ensemble> -cmd downconfig -confname _default -confdir ~/workspace/sitecoreXC93/conf/_default
  2. Create five copies of the _default directory and name them:
    • CECatalogItemsIndexConfig
    • CEOrdersIndexConfig
    • CECustomersIndexConfig
    • CEPriceCardsIndexConfig
    • CEPromotionsIndexConfig
  3. Copy the solrconfig.xml and managed-schema file available in the SolrSchemas folder of the SolrSchemas.Sitecore.Commerce.x.x.x zip file, included in the Sitecore XC release package:
    • Copy the SolrSchemas\CatalogItems\*.* files to the CECatalogItemsIndexConfig folder.
    • Copy the SolrSchemas\Orders\*.* files to the CEOrdersIndexConfig folder.
    • Copy the SolrSchemas\Customers\*.* files to the CECustomersIndexConfig folder.
    • Copy the SolrSchemas\PriceCards\*.* files to the CEPriceCardsIndexConfig folder.
    • Copy the SolrSchemas\Promotions\*.* files to the CEPromotionsIndexConfig folder.
  4. Upload the five config folders to zookeeper:
    ./ -zkhost <zookeeper ensemble> -cmd upconfig -confname CECatalogItemsIndexConfig -confdir ~/workspace/sitecoreXC93/conf/CECatalogItemsIndexConfig ./ -zkhost <zookeeper ensemble> -cmd upconfig -confname CEOrdersIndexConfig -confdir ~/workspace/sitecoreXC93/conf/CEOrdersIndexConfig ./ -zkhost <zookeeper ensemble> -cmd upconfig -confname CECustomersIndexConfig -confdir ~/workspace/sitecoreXC93/conf/CECustomersIndexConfig ./ -zkhost <zookeeper ensemble> -cmd upconfig -confname CEPriceCardsIndexConfig -confdir ~/workspace/sitecoreXC93/conf/CEPriceCardsIndexConfig ./ -zkhost <zookeeper ensemble> -cmd upconfig -confname CEPromotionsIndexConfig -confdir ~/workspace/sitecoreXC93/conf/CEPromotionsIndexConfig

Create Collections

Create the following collections with the respective configs:

Collection Name Config
CatalogItemsScope CECatalogItemsIndexConfig
CatalogItemsScope-Rebuild CECatalogItemsIndexConfig
CustomersScope CECustomersIndexConfig
CustomersScope-Rebuild CECustomersIndexConfig
OrdersScope CEOrdersIndexConfig
OrdersScope-Rebuild CEOrdersIndexConfig
PriceCardsScope CEPriceCardsIndexConfig
PriceCardsScope-Rebuild CEPriceCardsIndexConfig
PromotionsScope CEPromotionsIndexConfig
PromotionsScope-Rebuild CEPromotionsIndexConfig
sitecore_sxa_web_index config used for sitecore_web_index
sitecore_sxa_master_index config used for sitecore_master_index

Configure Sitecore Commerce

Change the Connection String to SolrCloud

  1. Navigate to \App_Config\ConnectionStrings.config.

  2. Update the Solr connection string so that you enable SolrCloud mode, by adding SolrCloud = true.

<add name="" connectionString="https://<loadbalancer URL>/solr;solrCloud=true" />

Setting Up Config Files

Sitecore will mostly communicate to Solr via the settings of Sitecore XP.

Other than that, the following files will need to be updated as well:

How to Update the Files:

  1. Open each PlugIn.Search.Solr.PolicySet-1.0.0.json file.
  2. Set the following parameters:
    "IsSolrCloud" : "true" "SolrUrl" : "<loadbalancerUrl>/solr"

Bootstrap Sitecore Commerce

  1. Follow the instructions here to download and set up a Postman project that can interact with Sitecore Commerce and help perform Ops tasks:
  2. After successfully setting up the Postman project, use the following instructions to Bootstrap Commerce Engine:
  3. After a successful bootstrap, use the following instructions to clean and initialize the environment: