Platform Administration and Architecture

Walkthrough: Using SolrCloud for xConnect search

Note

This topic is valid for Sitecore 9.0 Update 2 and later. Refer to the Knowledge Base for information about compatible versions of Solr.

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.

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

This walkthrough describes how to:

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.

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

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:

    solr zk upconfig -d basic_configs -n xdb -z <ZOOKEEPER_URL>
    

You have now prepared the Solr configuration, and you can now create the 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
  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.

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>\solrcommands\schema.json file to both cores using the Solr Schema API.

Note

You must 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

Do not give a collection and an alias the same name.

You have now created a SolrCloud farm. Before you can use it with xConnect, you must configure the xConnect roles 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.

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:

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

    <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. New deployments do not require this step.