Walkthrough: Setting up SolrCloud on Sitecore XC
Commerce Search supports SolrCloud (the Solr scaled environment). This walkthrough describes how to configure Sitecore XC environments and use SolrCloud as a search provider. It does not describe how to install SolrCloud itself.
As with Sitecore XP SolrCloud configuration, Sitecore XC SolrCloud configuration requires a load balancer.
SolrCloud affects the following Commerce environments:
- Authoring
- Minions
- DevOps
It is possible to use separate Solr servers for the xConnect search indexes and Content Search indexes.
This topic is valid for Sitecore XC 9, Update 3, and later.
This walkthrough describes how to:
- Create a SolrCloud farm
- Implement a health check
- Upload the configuration to Zookeeper
- Create collections
- Configure Commerce Engine to use SolrCloud
- Enable support for SSL
Create a SolrCloud farm
Follow the instructions on the Solr website to install Solr and create a scaled environment, using two or more Solr nodes with one or more external Zookeeper services.
Alternatively, if you have already created a scaled Solr environment for your Sitecore XP deployment (described here), you can use the same SolrCloud instance for the Commerce Engine.
This walkthrough assumes a simple cluster with two Solr nodes and one Zookeeper service.
Implement a health check
It is recommended that you configure your load balancer to check whether each Solr node is available and returning status code OK. Refer to the Solr ping documentation for more information.
If you have two Solr nodes behind a load balancer, you need to check every Commerce Search Index for each node. By default, each Solr node should have three indexes: one index each for CatalogItems, Orders, and Customers.
Upload the configuration to Zookeeper
Follow these steps to upload the Solr configuration to Zookeeper:
-
In one of the Solr nodes you have set up, create five new folders under the
<node1_root>\<solr install folder>\server\solr\configsetsfolder :- CECatalogItemsIndex
- CEOrdersIndex
- CECustomersIndex
- CEPriceCardsIndex
- CEPromotionsIndex
-
In the
configsetsfolder, locate and copy thedefaultfolder into each new sub-folder you created above. -
Copy the Sitecore XC Solr schema files for each Sitecore XC index to the appropriate sub-folder.
Sitecore XC Solr schemas are available in the
SolrSchemasfolder of theSolrSchemas.Sitecore.Commerce.x.x.xzip file, included in the Sitecore XC release package.- Copy the
SolrSchemas\CatalogItems\*.*files to theconfigsets\CECatalogItemsItems\conffolder. - Copy the
SolrSchemas\Customers\*.*files to theconfigsets\CECustomersIndex\conffolder. - Copy the
SolrSchemas\Orders\*.*files to theconfigsets\CEOrders\basic_configs\conffolder. - Copy the
SolrSchemas\PriceCards\*.*files to theconfigsets\CEPriceCardsIndex\conffolder. - Copy the
SolrSchemas\Promotions\*.*files to theconfigsets\CEPromotionsIndex\conffolder.
- Copy the
-
In the
<solr_root>folder, run the following commands:
Create collections
When you have uploaded the Solr configurations to Zookeeper, you can create each Sitecore XC collection.
Follow these steps to create your Sitecore XC collections:
-
Navigate to the Collections page in the Solr admin UI, using one of the nodes you created.
-
Click Add Collection.
-
Specify values for the following fields and click Add Collection to create the CatalogItemsScope collection:
- name: CatalogItemsScope
- config set: CECatalogItemsIndexConfig
- numShards:
- replicationFactor:
-
Repeat for the following other index:
-
OrdersScope index (where config set is
CEOrdersIndexConfig) -
CustomersScope index (where config set is
CECustomersIndexConfig) -
PriceCardsScope index (where config set is
CEPriceCardsIndexConfig) -
PromotionsScope index (where config set is
CEPromotionsIndexConfig)
NoteThe index names
CatalogItemsScope,OrdersScope,CustomersScope,PromotionsScopeandPriceCardsScopeare default values. You can customize these names, but they must match the names specified in thePlugIn.Search.PolicySet-1.0.0.json. -
-
Repeat to create the following collection of indexes to be used as secondary indexes by the switch on rebuild feature:
- CatalogItemsScope-Rebuild index (where config set is
CECatalogItemsIndexConfig) - OrdersScope-Rebuild index (where config set is
CEOrdersIndexConfig) - CustomersScope-Rebuild index (where config set is
CECustomersIndexConfig) - PriceCardsScope-Rebuild index (where config set is
CEPriceCardsIndexConfig) - PromotionsScope-Rebuild index (where config set is
CEPromotionsIndexConfig)
- CatalogItemsScope-Rebuild index (where config set is
Configure Commerce Engine to use SolrCloud
Both Commerce Engine and Sitecore require a connection to a load balancer. The load balancer must handle the failover for the Solr nodes.
Follow these steps for each environment to configure Commerce Engine to use SolrCloud as a search provider:
- Open the
PlugIn.Search.Solr.PolicySet-1.0.0.jsonfile. - Set the following parameters:
"IsSolrCloud" : "true""SolrUrl" : "<loadbalancerUrl>/solr"
- Bootstrap the Commerce Engine.
Enable support for SSL
If you have enabled SSL for Solr, you must:
- Ensure that the
solr.searchconnection string in theConnectionStrings.configfile is an https URL.