How to Integrate Apache Solr with Sitecore Commerce 9.2 using the SearchStax Cloud Connector for Sitecore
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.2.
Contents:
- Download and Prep
- Prepare the Install Script
- Install Sitecore Commerce
- Run the SearchStax Cloud Connector for Sitecore
- Bootstrap Sitecore Commerce
Download and Prep
Sitecore Commerce requires that the following packages to be downloaded and extracted before starting the installation:
- Redis
- Sitecore Commerce 9.2
- Sitecore PowerShell Extension 5.0 for Sitecore 9.2
- Sitecore Experience Accelerator 1.9
- MSBuild Microsoft Visual Studio Web targets (available from Nugent)
Redis
Download the msi file and follow the prompts for installation.
Package Name | URL |
---|---|
Redis on Windows 3.2 | https://github.com/microsoftarchive/redis/releases |
Sitecore Commerce 9.2
Download the following package:
Package Name | URL |
---|---|
Packages for On-Premises2019.08-x.x.xxx | https://dev.sitecore.net/Downloads/Sitecore_Commerce/92/Sitecore_Experience_Commerce_92_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 PowerShell Extension 5.0 for Sitecore 9.2
Download the following package:
Package Name | URL |
---|---|
Sitecore PowerShell Extension 5.0 for Sitecore 9.2 | https://dev.sitecore.net/Downloads/Sitecore_Experience_Accelerator/19/Sitecore_Experience_Accelerator_190.aspx |
Copy the downloaded content into C:\deploy
.
Sitecore Experience Accelerator 1.9
Download the following package:
Package Name | URL |
---|---|
Sitecore Experience Accelerator for 9.2 | https://dev.sitecore.net/Downloads/Sitecore_Experience_Accelerator/19/Sitecore_Experience_Accelerator_190.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.
- Create a new project, ASP.NET Web Application (.NET Framework) C#
- 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:\deploy\MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0.3\tools\VSToolsPath\Web\Microsoft.Web.XmlTransform.dll
.
Prepare the Install Script
The script is located at c:\deploy\SIF.Sitecore.Commerce.x.x.xxx\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.2. If yes, then make the following changes:
Variable | Value |
---|---|
[string]$SiteNamePrefix | "sitecore92" (enter your prefix here) |
[string]$SqlUser | "sa" |
[string]$SqlPass | password |
Comment out or remove these variables for Solr:
# SolrRoot = "c:\\solr-7.5.0"
# SolrService = "solr-7.5.0"
# SolrSchemas
You must also set the following variables and values:
Variable | Value |
---|---|
SolrUrl | https://ss123456-kk4krf07-us-west-1-aws.searchstax.com/solr |
Go to C:\deploy\SIF.Sitecore.Commerce.3.0.28\Configuration\Commerce\Solr\Solr.Install.json and change the value of Skip.Solr to True
"Skip.SOLR": "True"
Install Sitecore Commerce
- Open PowerShell v5 as an administrator.
- Navigate to
C:\deploy\SIF.Sitecore.Commerce.3.0.28
. - Set the execution policy to bypass:
Set-ExecutionPolicy Bypass
- Execute the script:
.\MyDeploy-Sitecore-Commerce.ps1
- Manually remove the following folder:
C:\inetpub\wwwroot\$Prefix.SC\SiteUtilityPages
Run the SearchStax Cloud Connector for Sitecore
Run the SearchStax Cloud Connector for Sitecore on the Sitecore Computer
The SearchStax Cloud Connector for Sitecore must be run on the same Windows computer as your Sitecore instance.
The script automates the following parts of the procedure:
- Upload the Solr config files to Solr
- Create the Sitecore collections in Solr
- Configure Sitecore Commerce files
Follow the instructions in Sitecore 9.2 – Run the SearchStax Cloud Connector for Sitecore. Be sure to set the configurationMode to “COMMERCE”, and to specify a commerceServicesPostfix value.
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/92/sitecore-experience-commerce/clean-and-initialize-the-environment.html
Questions?
Do not hesitate to contact the SearchStax Support Desk.