---
title: "Walkthrough: Using SolrCloud for xConnect search"
slug: "walkthrough--using-solrcloud-for-xconnect-search"
abstract: "A guide to using SolrCloud for xConnect search."
---
# Walkthrough: Using SolrCloud for xConnect search

This topic describes how to configure SolrCloud as the search provider for xConnect search. You must configure the following roles and environments:

- xConnect Collection Search service
- xConnect Search Indexer
- Standalone developer environments (XP Single) that combine xConnect Collection Search and xConnect Search Indexer

> [!note]
> If you configure SolrCloud for a standalone developer environment (XP Single), you must still configure the xConnect Search Indexer separately. The indexer is a Windows Service or, in Azure, a Web Job. By default, it is nested in the root of the xConnect Collection Search service role.

You can also configure SolrCloud for [content search](https://doc.sitecore.com/xp/en/developers/93/platform-administration-and-architecture/walkthrough--setting-up-solrcloud.html "Walkthrough: Setting up SolrCloud").

In order to use SolrCloud for xConnect search, you must create a SolrCloud farm and configure xConnect.

This walkthrough describes how to:

- Install Solr
- Upload the Solr configuration to Zookeeper
- Create an xDB collection
- Create aliases
- Configure xConnect to use SolrCloud

## Install Solr

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. The following descriptions assume that you have a simple cluster with one Zookeper service and two Solr nodes placed behind a load balancer.

> [!important]
> Sitecore's SolrCloud configuration requires a load balancer. xConnect is secure by default and assumes that you have enabled [Solr SSL](https://lucene.apache.org/solr/guide/6_6/enabling-ssl.html#EnablingSSL-SolrCloud).

We recommend that you configure your load balancer to check that all Solr nodes are available and that they return the *OK* status code. Refer to Solr's ping documentation for more information.

For example, if you have two nodes behind a load balancer, check the following endpoints:

- `https://<solr-node-1>/solr/xdb/admin/ping`
- `https://<solr-node-1>/solr/xdb_rebuild/admin/ping`
- `https://<solr-node-2>/solr/xdb/admin/ping`
- `https://<solr-node-2>/solr/xdb_rebuild/admin/ping`

## Upload the Solr configuration to Zookeeper

To upload the Solr configuration to Zookeper:

1. Open a PowerShell console and navigate to the `<solr_root>` folder.
2. In the console, enter the following command:

    ```text
    solr zk upconfig -d _default -n xdb -z <ZOOKEEPER_URL>”
    ```

You have now prepared the Solr configuration, and you can now create the xDB collection.

## Create an xDB collection

To create an **xDB** collection:

1. In the Solr administration UI, go to the Collections page using one of the nodes you created.
2. Click **Add Collection**.
3. Create a collection named *xdb_internal*. Use the *xDB* config set and specify other settings as shown:

    ![xdb_collection1.png](https://doc.sitecore.com/api/markdown-image/xp/en/developers/93/platform-administration-and-architecture/images/xdb_collection1.png)

4. Create a second collection named *xdb_rebuild_internal* with the same settings.

Refer to the SolrCloud documentation for information about collections, replicas, and shards.

## Create aliases

To create aliases for your collections:

1. In the Solr administration UI, go to the Collections page using one of the nodes you created.
2. Click **Create Alias**.
3. Create an alias named *xdb_rebuild* and in the **Collections** list, click *xdb_rebuild_internal*.
4. Create a second alias named *xdb* and select *xdb_internal* in the **Collections** list.
5. To see a list of all aliases, use the URL `https://<solrurl>/solr/admin/collections?action=LISTALIASES`.
6. Apply the schema modifications from the `<xconnect-root>\App_Data\solrcommands\schema.json` file to *both* collections using the Solr Schema API.

> [!note]
> Use *xdb* and *xdb\_rebuild* in your connection strings, **not** *xdb\_internal* and *xdb\_rebuild\_internal*. *xdb* and *xdb\_rebuild* are the default names of the primary and secondary indexes. If you change the names of the indexes, you must update all connection strings.

> [!note]
> Don't give a collection and an alias the same name.

You have now created a SolrCloud farm. Before you can use it with xConnect, configure the xConnect roles to use SolrCloud.

## Configure xConnect to use SolrCloud

You must configure the xConnect connection to the SolrCloud load balancer, which handles the fail-over for the Solr nodes.

> [!note]
> This example assumes that you have [set up SSL](https://lucene.apache.org/solr/guide/6_6/enabling-ssl.html#EnablingSSL-SolrCloud).

To configure xConnect to use SolrCloud:

1. For every instance of the xConnect Collection Search role, open the `<role-root>\App_Config\ConnectionStrings.config` file, specify the value of the `solrCore` connection string, and add the parameter `solrCloud=true`. For example:

    ```text
    <add name="solrCore" connectionString="https://<loadbalancer>:8999/solr/xdb;solrcloud=true"/>
    ```

2. For every instance of the xConnect Search Indexer role, open the `<role-root>\App_Config\ConnectionStrings.config` file, specify the value of the `solrCore` connection string, and add the parameter `solrCloud=true`. For example:

    ```text
    <add name="solrCore" connectionString="https://<loadbalancer>:8999/solr/xdb;solrcloud=true"/>
    ```

    > [!note]
    > By default, the xConnect Search Indexer is located in the xConnect Collection Search service role, in the `<role-root>\App_data\jobs\continuous\IndexWorker` folder.

3. If you migrate an existing deployment from Solr to SolrCloud you must [rebuild the index](https://doc.sitecore.com/xp/en/developers/93/sitecore-experience-platform/en/rebuild-the-xdb-index-in-solr.html). New deployments do not require this step.