How to Integrate Apache Solr with Sitecore Commerce 9.1 using SearchStax Cloud
Overview
SearchStax Cloud can be used to enable Apache Solr on a Sitecore Commerce website.
Sitecore Commerce using SearchStax Cloud must be installed on top of an already existing Sitecore (XP) installation. Please see our guide on installing Sitecore 9.1.
Contents:
- Download and Prep
- Prepare the Install Script
- Install Sitecore Commerce
- Configure Solr
- Configure Sitecore Commerce
Download and Prep
Sitecore Commerce requires that the following packages to be downloaded and extracted before starting the installation:
- Sitecore Commerce 9.1
- Sitecore PowerShell Extension 4.7 or 5.0
- Sitecore Experience Accelerator 1.8-1
- MSBuild Microsoft Visual Studio Web targets
Sitecore Commerce 9.1
Download the following package:
Package Name | URL |
---|---|
Packages for On Premise 2019.04-3.0.163 | https://dev.sitecore.net/Downloads/Sitecore_Commerce/91/Sitecore_Experience_Commerce_91_Initial_Release.aspx |
- Create a
C:deploy
directory. - Extract the contents of the downloaded package into
C:deploy
. - Navigate to
C:deploy
, and extract the following packages:- SIF.Sitecore.Commerce.x.x.xxxx.zip
- Sitecore.Commerce.Engine.x.x.xxxx.zip
- Sitecore.Commerce.Engine.SDK.x.x.xxxx.zip
- Sitecore.BizFX.x.x.xxx.zip
- Make a note of the file
Sitecore.Commerce.Engine.DB.dacpac
location. (Usually it will be atC:deploySitecore.Commerce.Engine.SDK.3.0.40Sitecore.Commerce.Engine.DB.dacpac
).
Sitecore PowerShell Extension 4.7 or 5.0
Download the following package:
Package Name | URL |
---|---|
Full 5.0 Release | https://dev.sitecore.net/Downloads/Sitecore_Experience_Accelerator/18/Sitecore_Experience_Accelerator_181.aspx |
Copy the downloaded content into C:deploy
.
Sitecore Experience Accelerator 1.8-1
Download the following package:
Package Name | URL |
---|---|
Sitecore Experience Accelerator for 9.1.1 | https://dev.sitecore.net/Downloads/Sitecore_Experience_Accelerator/18/Sitecore_Experience_Accelerator_181.aspx |
Copy the downloaded content into C:deploy
.
MSBuild Microsoft Visual Studio Web targets
- Create a new blank project in Visual Studio.
- Create a new project, ASP.NET Web Application (.NET Framework) C#

- Select Empty project, and then check the box for MVC, click create.

- Tools > NuGet Package Manager > Package Manager Console
- Execute the following command:
Install-Package MSBuild.Microsoft.VisualStudio.Web.targets -Version 14.0.0.3
- Open File Explorer and navigate to the root directory of the blank project.
- Navigate to packages.
- Copy the folder
MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0.3
. - Paste it to
C:deploy
. - Make a note of the location of
Microsoft.Web.XmlTransform.dll
. Usually it will be atC:deployMSBuild.Microsoft.VisualStudio.Web.targets.14.0.0.3toolsVSToolsPathWebMicrosoft.Web.XmlTransform.dll
.
Prepare the Install Script
The script is located at c:deploySIF.Sitecore.Commercec.x.x.xxxDeploy-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.1. If yes, then make the following changes:
Variable | Value |
---|---|
[string]$Prefix | "sitecore" (enter your prefix here) |
[string]$SiteName | "$Prefix.sc" |
[string]$SqlDbPrefix | "$Prefix" |
[string]$IdentityServerSiteName | "$Prefix.identityserver" |
XConnectInstallDir | "c:inetpubwwwroot$Prefix.xconnect" |
Comment out or remove these variables for Solr:
# SolrRoot = "c:solr-7.2.1"
# SolrService = "solr-7.2.1"
You must also set the following variables and values:
Variable | Value |
---|---|
CommerceEngineDacPac | Resolve-Path -Path "C:deploySitecore.Commerce.Engine.SDK.3.0.40Sitecore.Commerce.Engine.DB.dacpac" (Value noted in the steps above) |
SitecoreCommerceEnginePath | Resolve-Path -Path "..Sitecore.Commerce.Engine.3.0.163.zip" |
SitecoreBizFxServicesContentPath | Resolve-Path -Path "..Sitecore.BizFX.2.0.3.zip" |
PowerShellExtensionsModuleFullPath | Resolve-Path -Path "..Sitecore PowerShell Extensions*.zip" |
SXAModuleFullPath | Resolve-Path -Path "..Sitecore Experience Accelerator*.zip" |
SXACommerceModuleFullPath | Resolve-Path -Path "..Sitecore Commerce Experience Accelerator 2.*.zip" |
SXAStorefrontModuleFullPath | Resolve-Path -Path "..Sitecore Commerce Experience Accelerator Storefront 2.*.zip" |
Note
Since we are not using a local instance of Solr, we will disable installation of cores while Sitecore is being installed.
Disable Solr Core installation by updating the install command in the script to the following:
Install-SitecoreConfiguration @params -Skip InstallSolrCores -Verbose *>&1 | Tee-Object "$PSScriptRootXC-Install.log"
If you changed the default Sitecore password, please follow the instructions here to make sure the Sitecore Commerce installer is changed accordingly.
Install Sitecore Commerce
- Open PowerShell v5 as an administrator.
- Navigate to
C:deploySIF.Sitecore.Commerce.2.0.19
. - Set the execution policy to bypass:
Set-ExecutionPolicy Bypass
- Execute the script:
.MyDeploy-Sitecore-Commerce.ps1
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
- Use either the SearchStax API, or the SearchStax Client to upload/download the configs from Zookeeper.
- Download the existing
_default
config from Zookeeper. - Create three copies of the
_default
directory and name them:CatalogItems
Customers
Orders
- Navigate to
c:deploySIF.Sitecore.Commercec.x.x.xxxSolrSchemas
. - Copy the content of the
CatalogItems
folder to the copy of the_default
directory created above. - Copy the content of the
Customers
folder to the copy of the_default
directory created above. - Copy the content of the
Orders
folder to the copy of the_default
directory created above. - Upload
CatalogItems
,Customers
, andOrders
config directories to Zookeeper with the same name. - Upload the Sitecore default config as
sitecore_default
.
Create Collections
Create the following collections with the respective configs:
Collection Name | Config |
---|---|
sitecore_sxa_master_index | sitecore_default |
sitecore_sxa_web_index | sitecore_default |
CatalogItemsScope | CatalogItems |
CustomersScope | Customers |
OrdersScope | Orders |
Configure Sitecore Commerce
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:
C:inetpubwwwrootCommerceAuthoring_Sc9wwwrootdataEnvironmentsPlugIn.Search.Solr.PolicySet-1.0.0.json
C:inetpubwwwrootCommerceMinions_Sc9wwwrootdataEnvironmentsPlugIn.Search.Solr.PolicySet-1.0.0.json
C:inetpubwwwrootCommerceOps_Sc9wwwrootdataEnvironmentsPlugIn.Search.Solr.PolicySet-1.0.0.json
C:inetpubwwwrootCommerceShops_Sc9wwwrootdataEnvironmentsPlugIn.Search.Solr.PolicySet-1.0.0.json
How to Update the Files:
- Open to the desired file in an editor as an administrator.
- Set the following parameters:
"IsSolrCloud" : "true" "SolrUrl" : "<loadbalancerUrl>/solr"
Bootstrap Sitecore Commerce
- Follow the instructions here to download and set up a Postman project that can interact with Sitecore Commerce and help perform Ops tasks: https://doc.sitecore.com/xp/en/developers/92/sitecore-experience-commerce/execute-sample-api-calls-in-postman.html
- After successfully setting up the Postman project, use the following instructions to Bootstrap Commerce Engine: https://doc.sitecore.com/xp/en/developers/92/sitecore-experience-commerce/bootstrap-the-commerce-engine.html
- After a successful bootstrap, use the following instructions to clean and initialize the environment: https://doc.sitecore.com/xp/en/developers/91/sitecore-experience-commerce/clean-and-initialize-the-environment.html
Questions?
Do not hesitate to contact the SearchStax Support Desk.