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


Overview

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

Contents:

  1. Download and Prep
  2. Prepare the Install Script
  3. Install Sitecore Commerce
  4. Run the SearchStax Sitecore Plugin
  5. Bootstrap Sitecore Commerce

Download and Prep

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

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
  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:
    1. 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

  1. Create a new blank 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 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:

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://ss418450-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 Sitecore Plugin

Run the Plugin on the Sitecore Computer

The SearchStax Sitecore Plugin must be run on the same Windows computer as your Sitecore instance.

The script automates the following parts of the procedure:

Follow the instructions in Sitecore 9.2 - Run the SearchStax Sitecore Plugin. 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/developers/92/sitecore-experience-commerce/en/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/developers/92/sitecore-experience-commerce/en/bootstrap-the-commerce-engine.html
  3. After a successful bootstrap, use the following instructions to clean and initialize the environment: https://doc.sitecore.com/developers/92/sitecore-experience-commerce/en/clean-and-initialize-the-environment.html