Since a single Sitecore instance can be used to manage multiple websites, a frequent question we get from customers and prospects is how to implement this use case in SearchStudio so each website has its own search page. This post was authored by Hugo Santos from Konabos is a detailed step-by-step guide for demonstrating how easy it is to set up multi-site search using the SearchStudio for Sitecore module.
Prerequisites for Implementing Multi-Site Search
You can use the SearchStax SearchStudio for Sitecore module to power the search of multiple website search pages configured in a single Sitecore instance. In this article, we assume you already have your Sitecore configured to support multiple websites. If you need help with this Sitecore feature, visit the Configuring Multiple Managed Websites from the Sitecore Developers documentation..
Before configuring Multi-Site Search in Sitecore, make sure you have one search app for each Sitecore site you want to configure. Refer to the Creating a Site Search App article for details on how to create search apps in SearchStudio. This step is very important and will guarantee that results from one website will never be shown in other websites.
Now that you have your search apps ready, it’s time to finish the configuration in Sitecore to have SearchStax powering the search experience on each Search page you may have.
Scenario – Two Websites, Each One with a Single Search Page
Let’s assume you have the following scenario with two websites, each one of them having a single Search page:
Configure Two Different Index Cores
The goal here is to make sure the Site1 search page only shows results for Site1, and Site2 only shows results for Site2. The way to achieve this goal using SearchStudio is to configure two different index cores, each one having a different crawler root.
To complete this step, open the SearchStax Configuration Page and click on CREATE AN INDEX. (For more information about how to do this, check out the SearchStudio Sitecore Module documentation.)
Create two different indexes and make sure you are pointing their crawler roots to your website’s home items.
Once you finish this step, you should have something similar to the following:
Rebuild your Schemas and Indexes
Once the configuration step is done, you need to repopulate your schemas and rebuild your indexes. Open your Sitecore admin page and click on Control Panel -> Populate Solr Managed Schema. Select the new collections and rebuild their schemas.
Open the Sitecore Indexing Manager and select all new indexes you just created then click on Rebuild:
Verify the Search Results
After rebuilding your indexes, you can open both search pages and confirm that they are showing the right results for each website:
SearchStax makes powerful search easy. Learn more about how you can use SearchStudio to analyze and optimize the search experience on your website.