Config Sets for Custom Indexes Search Stax

After working with Sitecore Managed Cloud for almost two plus years, my first encounter with managed cloud was in the year 2020. I blogged about all my learnings on Managed Cloud in series of blog posts. After all this time, I still bump in to something new with different implementations across various clients.

For instance, this client had custom indexes. I always frown about custom indexes because I personally think they are only needed in some very specific scenarios and there are bunch of blog posts out there to help you understand when you would actually need them. In this specific Sitecore instance, they need them because.. lol I dont know. We inherited this solution, so, that is that. Now, these custom indexes will not be magically set up by Sitecore when you ask them to create the environments. So, how do you go about it? Here are the steps below.

  1. SOLR credentials are provided to you or your team on the support ticket you may have created for Sitecore to whip up new environment
  2. Log on to that admin console of SOLR
  3. From there – you can create the custom collections you like – Name them with preferably best practices around it
  4. Also, of course your index configurations should be patched well with all that sync strategies per your needs
  5. Now, go to Control Panel and rebuild your custom index – Boom – Yes ? No…wait..but

There is always buts right? Okay, my custom index has custom config set and not the one Sitecore may have created by default when they create your instance. 🙂

So, how do we create new collection on SOLR console using custom schema? It is actually quite simple with some twists. Like I always say, I will not repeat myself on the stuff that is already out there. I followed below references to actually understand the HOW part. Here it goes:

https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB0848433

https://www.searchstax.com/docs/searchstax-cloud-dedicated-deployment-quick-start/#zkcli

Magic sauce is actually in the second link (section: Upload a SOLR configuration), but, first link is also important because that tells you exactly what options you have and what to do depending on option you picked. I picked option #2 noted on there which is to use zkcli. Yeah yeah, I am lazy you may think, but, I would like to think I am strategic. 😉

In my case option #2 will suffice as I have very simple needs and my managed schema config sets are actually checked in on source control, so, that is better approach than doing gymnastics with API. Most of the steps are clear in the second link above, but, I found their was additional ‘/’ that was throwing off my command. Plus, reminder if you are going with this option, you have to ask Sitecore via support ticket to whitelist your IP Range or IP Address. If you do not do this, command will not work and throw time out exceptions.

Before you run the below steps download zkcli https://github.com/searchstax/searchstax-client/archive/master.zip – Place the extracted version in your drive some where. It does not really matter where as long as you can go there.

I used powershell and I did CD to go the scripts folder inside the zkcli download mentioned above. Run the command that looks like below:

.\zkcli.bat -zkhost {zookeeper ensemble entry I grabbed from support ticket of environment creation details} -cmd upconfig -confdir ../configsets/{custom foldername inside your zkcli download }/conf/ -confname {name for config that would appear in SOLR}

Replace {with stuff in here} -> actual stuff noted (do not use those braces, I used them to suggest it is a placeholder and not real value)

If your IP is whitelisted and if you have JAVA installed with proper PATH variable set and yes if you are lucky, you will see your shiny new config set on SOLR once the command runs successfully. Once you have the config sets available, go back to your basic steps and when you are creating the collection you get to pick the custom config set.

Have fun you all!! I am sure more search stax interactions are yet to come soon. In the mean time, have fun.