---
title: "Walkthrough: Setting up SolrCloud on Sitecore XC"
slug: "walkthrough--setting-up-solrcloud-on-sitecore-xc"
abstract: "How to set up Sitecore XC environments for SolrCloud and configure the Commerce Engine to support it."
---
# 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.

> [!important]
> As with Sitecore XP SolrCloud configuration, Sitecore XC SolrCloud configuration requires a load balancer.

SolrCloud affects the following Commerce environments:

- Authoring
- Minions
- DevOps

> [!note]
> It is possible to use separate Solr servers for the xConnect search indexes and Content Search indexes.

> [!note]
> This topic is valid for Sitecore XC 9, Update 3, and later.

This walkthrough describes how to:

- [Create a SolrCloud farm](https://doc.sitecore.com/xp/en/developers/103/sitecore-experience-commerce/walkthrough--setting-up-solrcloud-on-sitecore-xc.html#UUID-f4b5c83b-4626-7e43-40a6-a1132b4c2c28_section-idm45403305184512 "Create a SolrCloud farm")
- [Implement a health check](https://doc.sitecore.com/xp/en/developers/103/sitecore-experience-commerce/walkthrough--setting-up-solrcloud-on-sitecore-xc.html#UUID-f4b5c83b-4626-7e43-40a6-a1132b4c2c28_section-idm46212281703840 "Implement a health check")
- [Upload the configuration to Zookeeper](https://doc.sitecore.com/xp/en/developers/103/sitecore-experience-commerce/walkthrough--setting-up-solrcloud-on-sitecore-xc.html#UUID-f4b5c83b-4626-7e43-40a6-a1132b4c2c28_section-idm46212281953920 "Upload the configuration to Zookeeper")
- [Create collections](https://doc.sitecore.com/xp/en/developers/103/sitecore-experience-commerce/walkthrough--setting-up-solrcloud-on-sitecore-xc.html#UUID-f4b5c83b-4626-7e43-40a6-a1132b4c2c28_section-idm46212281701040 "Create collections")
- [Configure Commerce Engine to use SolrCloud](https://doc.sitecore.com/xp/en/developers/103/sitecore-experience-commerce/walkthrough--setting-up-solrcloud-on-sitecore-xc.html#UUID-f4b5c83b-4626-7e43-40a6-a1132b4c2c28_section-idm45442802770192 "Configure Commerce Engine to use SolrCloud")
- [Enable support for SSL](https://doc.sitecore.com/xp/en/developers/103/sitecore-experience-commerce/walkthrough--setting-up-solrcloud-on-sitecore-xc.html#UUID-f4b5c83b-4626-7e43-40a6-a1132b4c2c28_section-idm46212281724944 "Enable support for SSL")

<details>
<summary><h2>Create a SolrCloud farm</h2></summary>

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](https://doc.sitecore.com/xp/en/developers/103/platform-administration-and-architecture/walkthrough--setting-up-solrcloud.html)), you can use the same SolrCloud instance for the Commerce Engine. 

> [!note]
> This walkthrough assumes a simple cluster with two Solr nodes and one Zookeeper service.

</details>

<details>
<summary><h2>Implement a health check</h2></summary>

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.

</details>

<details>
<summary><h2>Upload the configuration to Zookeeper</h2></summary>

Follow these steps to upload the Solr configuration to Zookeeper:

1. In one of the Solr nodes you have set up, create five new folders under the `<node1_root>\<solr install folder>\server\solr\configsets` folder :
    - CECatalogItemsIndex
    - CEOrdersIndex
    - CECustomersIndex
    - CEPriceCardsIndex
    - CEPromotionsIndex
2. In the `configsets` folder, locate and copy the `default` folder into each new sub-folder you created above. 
3. 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 `SolrSchemas` folder of the `SolrSchemas.Sitecore.Commerce.x.x.x` zip file, included in the Sitecore XC release package.

    - Copy the `SolrSchemas\CatalogItems\*.*` files to the `configsets\CECatalogItemsItems\conf` folder.
    - Copy the `SolrSchemas\Customers\*.*` files to the `configsets\CECustomersIndex\conf` folder.
    - Copy the `SolrSchemas\Orders\*.*` files to the `configsets\CEOrders\basic_configs\conf` folder.
    - Copy the `SolrSchemas\PriceCards\*.*` files to the `configsets\CEPriceCardsIndex\conf` folder.
    - Copy the `SolrSchemas\Promotions\*.*` files to the `configsets\CEPromotionsIndex\conf` folder.
4. In the `<solr_root>` folder, run the following commands: 

    ```

    solr zk upconfig -d CECatalogItemsIndex\conf -n CECatalogItemsIndexConfig -z <ZOOKEEPER_URL>
    solr zk upconfig -d CEOrdersIndex\conf -n CEOrderIndexConfig -z <ZOOKEEPER_URL>
    solr zk upconfig -d CECustomersIndex\conf -n CECustomerIndexConfig -z <ZOOKEEPER_URL>
    solr zk upconfig -d CEPriceCardsIndex\conf -n CEPriceCardsIndexConfig -z <ZOOKEEPER_URL>
    solr zk upconfig -d CEPromotionsIndex\conf -n CEPromotionsIndexConfig -z <ZOOKEEPER_URL>
    ```

</details>

<details>
<summary><h2>Create collections</h2></summary>

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:

1. Navigate to the Collections page in the Solr admin UI, using one of the nodes you created.
2. Click **Add Collection**.
3. Specify values for the following fields and click **Add Collection** to create the CatalogItemsScope collection:
    - **name:** CatalogItemsScope
    - **config set**: CECatalogItemsIndexConfig
    - **numShards**: <number of shards>
    - **replicationFactor**: <replication factor>
4. 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`)

    > [!note]
    > The index names `CatalogItemsScope`, `OrdersScope`, `CustomersScope`, `PromotionsScope` and `PriceCardsScope` are default values. You can customize these names, but they must match the names specified in the `PlugIn.Search.PolicySet-1.0.0.json`.

5. Repeat to create the following collection of indexes to be used as secondary indexes by the [switch on rebuild](https://doc.sitecore.com/xp/en/developers/103/sitecore-experience-commerce/switch-commerce-indexes-during-rebuild.html "Switch Commerce indexes during 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`)

</details>

<details>
<summary><h2>Configure Commerce Engine to use SolrCloud</h2></summary>

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:

1. Open the `PlugIn.Search.Solr.PolicySet-1.0.0.json` file.
2. Set the following parameters:
    - `"IsSolrCloud" : "true"`
    - `"SolrUrl" : "<loadbalancerUrl>/solr"`
3. [Bootstrap the Commerce Engine](https://doc.sitecore.com/xp/en/developers/103/sitecore-experience-commerce/bootstrap-the-commerce-engine.html "Bootstrap the Commerce Engine").

</details>

<details>
<summary><h2>Enable support for SSL</h2></summary>

If you have enabled SSL for Solr, you must:

- Ensure that the `solr.search` connection string in the `ConnectionStrings.config` file is an *https* URL.

</details>