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:

  1. Download and Prep
  2. Prepare the Install Script
  3. Install Sitecore Commerce
  4. Run the SearchStax Cloud Connector for Sitecore
  5. 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 NameURL
Redis on Windows 3.2https://github.com/microsoftarchive/redis/releases

Sitecore Commerce 9.2

Download the following package:

Package NameURL
Packages for On-Premises2019.08-x.x.xxxhttps://dev.sitecore.net/Downloads/Sitecore_Commerce/92/Sitecore_Experience_Commerce_92_Initial_Release.aspx
  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:
    • SIF.Sitecore.Commerce.x.x.xxxx.zip

Sitecore PowerShell Extension 5.0 for Sitecore 9.2

Download the following package:

Package NameURL
Sitecore PowerShell Extension 5.0 for Sitecore 9.2https://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 NameURL
Sitecore Experience Accelerator for 9.2https://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

  1. Create a new blank project in Visual Studio.
    • Create a new project, ASP.NET Web Application (.NET Framework) C#SearchStax Sitecore Commerce
    • 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 14.0.0.3
  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.14.0.0.3.
  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.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:

VariableValue
[string]$SiteNamePrefix"sitecore92" (enter your prefix here)
[string]$SqlUser"sa"
[string]$SqlPasspassword

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:

VariableValue
SolrUrlhttps://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

  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:
    .\MyDeploy-Sitecore-Commerce.ps1
  5. 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

  1. 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
  2. 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
  3. 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.