SearchStax — Solr-as-a-service for Sitecore

SitecoreHandbook
5 min readApr 23, 2022

This post assumes that you are aware of the basics of search using Solr or Solr Cloud with Sitecore.

Why do we need Solr-as-a-service?

Standard Solr setup in a production environment, usually requires multiple instances to ensure close to zero downtime. This means, a Solr Cloud production installation would typically consist of at least 2 Solr instances that are load-balanced and replicated for DR (Disaster Recovery). You would also require a Zookeeper i.e. a centralised service for maintaining configuration information in a distributed system.

If the same setup has to be replicated to lower environments (e.g. UAT or any other non-Production environment), in theory, the same setup would need to be replicated on each environment! So, for setting this up on 2 non-Production environments, it would require nearly 6–8 instances of Solr with 2–4 load balancers. This would consume significant developer time & effort. Moreover implementing such complex cluster setups, would unnecessarily overburden Infrastructure teams with the maintenance & deployment of the extra servers & resources required for SolrCloud.

This is where Solr-as-a-Service, can prove to be an effective solution i.e. allowing Solr instances to be managed externally on the Cloud, with the added benefit of features such as monitoring & alerting, disaster recovery, etc. In effect, an organization’s precious developer time & effort could instead be used in other activities adding business value & enabling high performance systems.

Solr-as-a-Service is very suitable for projects with strict or short timelines. Moreover, for organizations using Sitecore, given that Azure Search is due to be deprecated shortly after Sitecore 10, Solr-as-a-Service (SearchStax) offers a viable alternative to Azure Search when hosting Sitecore as PaaS.

Advantages of using SearchStax:

  • Built-in monitoring and alerting mechanisms
  • Cloud Automation
  • Backups and disaster recovery
  • High availability cluster with 2 or more Solr nodes , 3 Zookeeper nodes , 1 Load Balancer for Production , multi-region similar clusters
  • Private cloud instances (VNet Peering or VPC Peering); in case of additional security requirements Azure, AWS, Google providers are available
  • Reduction in infrastructure costs

Search Stax offers two products:

  • ManagedSolr (Solr on Cloud — Solr Cloud Hosting service)
  • SearchStudio (ready to use AI driven search service with content recommendation — similar to Coveo)

The scope of this article is limited to SearchStax Managed Solr. SearchStudio will be covered in subsequent posts.

Populating your Solr indexes on SearchStax ManagedSolr

  • Create a new deployment using Cloud Manager
  • Install Powershell core on your machine

iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI"

  • Install Powershell core

> Install-Module powershell-yaml

The accountName and DeploymentUid are available on your SearchStax account.

  • Enable IP filter to allow your machine to access your SearchStax Node under the Security section.
  • Open the Powershell Core as Admin. Change the execution policy to skip checking.
    Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
  • Run the sitecore-searchstax-connector.ps1 script. This script will upload Solr config files from your Sitecore instance to the Searchstax Zookeeper ensemble. Create Solr collections and cores defined in your configs and also update your Sitecore content Search configs, connectionstrings and webconfig to point to the newly created SearchStax Cloud Solr node.

> .sitecore-searchstax-connector.ps1

  • Note : To avoid permission issues, please ensure that your accountName and DeploymentUid on the config file is correct.

You can also try the authentication and also access your deployment nodes via the SearchStax APIs.

Generate Token

curl — location — request POST ‘https://app.searchstax.com/api/rest/v2/obtain-auth-token/' \
— header ‘Content-Type: application/json’ \
— data-raw ‘{
“username”:”manohar-r@hcl.com”,
“password”: “******”
}’

Check the health of your node on SearchStax

curl — location — request GET ‘https://app.searchstax.com/api/rest/v2/account/{AccountName}/deployment/{deploymentId}' \
— header ‘Authorization: Token {yourtoken}’

  • I encountered another issue related to incorrect Sitecore paths while updating connection strings and config files

To fix this issue, you will have to tweak {plugin_extract_path}/src/searchstax-sitecore-xp.ps1 to point to your Sitecore instance path

Upon successful completion of the Powershell script:

  • All your Sitecore Solr collections and cores should now be migrated to your SearchStax Cloud Solr instance
  • Solr config files should also be migrated to your SearchStax instance
  • Your Solr connectionStrings should now be updated to point to the Searchstax instance
  • Now, populate schema and rebuild your Sitecore indexes from Sitecore using the Indexing Manager

That’s it!

You can now enjoy your Solr-as-a-Service environments and let SearchStax take care of the upkeep/maintenance, DR replication, etc. of your Solr setup!

--

--