Sitecore Module


SearchStax provides a special module that connects Sitecore directly to Site Search and lets you publish a custom search page immediately.  

“Sitecore Plugin” vs. “Sitecore Module”

The Sitecore Plugin connects your Sitecore CMS to SearchStax Solr Cloud for indexing. See, for instance, Sitecore Plugin.

The Sitecore Module (this page) connects your Sitecore CMS to SearchStax Site Search for a customized search experience.

Contents:

What is the Sitecore Module?

This package is a Sitecore module that Sitecore developers can install to leverage all the search capabilities offered by SearchStax Site Search for your client-facing search pages. It contains a Sitecore index connector which can index your Sitecore items using the out-of-the-box Indexing Manager provided by Sitecore. Not only that, but it comes with a functional search page that can be built in minutes instead of weeks of work. With this package your client can focus immediately on improving the real search experience, since that is where the business value is.

First, create a Site Search App!

You cannot install the Sitecore Module until you have created a Site Search App.

The App must have suggestions enabled on the Auto-Suggest Tab.

Install the Sitecore Module

The first step is to contact SearchStax team and ensure you already have a Site Search account and App created with Solr core configured to deal with your Sitecore. They will do this for you, so do not worry. Once you have this you are ready to go.

This is almost a plug-and-play module, thus installing it is as easy as possible.

Below are the supported Sitecore versions, with the links for downloading the Sitecore package:

Sitecore VersionPackage
Sitecore 9.0SearchStax package for 9.0
Sitecore 9.0 Update 2SearchStax package for 9.0.2
Sitecore 9.1 SearchStax package for 9.1 and 9.2
Sitecore 9.2SearchStax package for 9.1 and 9.2
Sitecore 9.3SearchStax package for 9.3, 10.0, 10.1
Sitecore 10.0SearchStax package for 9.3, 10.0, 10.1
Sitecore 10.1SearchStax package for 9.3, 10.0, 10.1
Sitecore SXA (All versions)SearchStax package for SXA

Once you download the package, open the Sitecore Installation Manager:

Use the Choose package option to select the downloaded file and upload it to your Sitecore.

Once the package is uploaded it’s time to properly install it. You can do this by clicking on Next and then on Install.

The installation should take no more than a few minutes. You will know the installation is completed when you see the below pop-up. Go ahead and click on the Configure SearchStax for Sitecore Package button:

Configure the Sitecore Module

The above button will open the list of Site Search Indexes (Site Search Apps) associated with your Sitecore project. (You can reach this page whenever you want to change these values from either the Sitecore Control Panel or the Launchpad.) The list is initially empty:

Click the Create an Index button. This opens the Sitecore Module Index configuration page. This is where you can configure the search module.

  • Root Item: From the Content Editor, enter the root node of the items you want to add to this index. By default, the module will index every page under /sitecore/content/home/.
  • Read Only Solr User Name, Password and Admin Solr User Name and Password: These are the “Read-Only API Credentials” and the “Read-Write Search API Credentials” from the Search API tab of the Site Search > Navigation Menu > Search App > Settings > Apps Settings screen. You’ll have to scroll down to the bottom of the screen to find them. The User ID is set by the system, but you can set the password (both Read only and Read Write need to be set).
  • Search Endpoint: This is the search endpoint that is required by SearchStax search page. You can find this value as the “Search URL” on the Search API tab of the Site Search > Navigation Menu > Search App > Settings > Apps Settings screen.
  • Auto-Suggest Endpoint: This is the auto-suggest endpoint that is required by SearchStax search page. You can find this value as the “Suggest URL” on the Search API tab of the Site Search > Navigation Menu > Search App > Settings > Apps Settings screen. (If this field is empty, enable suggestions on the Auto-Suggest Tab of the Site Search > Relevance > Basic Relevance page.)
  • Analytics API Key: This is the API Key required by SearchStax to log your search analytics events correctly to your application. Those events can be used later to improve the search experience through the dashboards offered by Site Search. You can find this value as the “Analytics Key” on the Analytics API tab of the Site Search > Navigation Menu > Search App > Settings > Apps Settings screen. 

Clicking Save returns you to the list of indexes where you can see the index you just created:

Populate Schema and Rebuild

Once you have installed and configured the Sitecore module, you must run a Populate Schema operation on this new Solr collection to update its schema with the one used by Sitecore. You can find more details about this at https://doc.sitecore.com/en/developers/90/platform-administration-and-architecture/solr-managed-schemas.html. This is a common operation that must be executed on every Solr index used in Sitecore and is very easy to perform. Open your Sitecore admin page and click on Control Panel -> Populate Solr Managed Schema.

Select your previously configured core name and then click on Populate.

Once this operation is completed, you should see a success message like this:

Now go back to the Control Panel and click on Indexing Manager. When it opens, select your previously configure core name and click on Rebuild.

Usually, it should only take a few minutes but keep in mind that the time this operation will take is proportional to the number of items you have in your Sitecore. 

Once this operation is completed you should see a success message like this:

This means that your schema is updated and your SearchStax index is ready to receive new indexed items and search queries.

Once the schema is populated and the data is rebuilt, you can start configuring Site Search, selecting what data you would like to see in Results, and creating a default model. Before creating your Search Page in Sitecore, the following 3 Steps should be performed in Site Search:

(You can search site search directly by going to www.searchstudio.com or click on Search Management from within Sitecore as shown below)

  • Reload schema changes in Site Search
    • Goto Site Search > Navigation Menu > Search App > Settings > Apps Settings > Search API tab.
    • Click on “Reload Schema” button. This syncs schema changes to Site Search.

  • Configure Result Fields in Site Search
    • Goto Site Search > Navigation Menu > Search App > Search Experience > Results Configuration
    • Select all fields that you would like to be displayed as Result Items. You can map some of the fields to the Result Cards to show them in a special way. Make sure you have aleast one field set up.
    • Click on Publish to publish the Results Configuration.
  • Configure Relevance Model for Site Search
    • Go to Site Search > Navigation Menu > Search App > Relevance > Relevance Modeling
    • Click on “Create a Model” and create a new model named “Default”. If one already exists, you can click on it to edit it.
    • Check “Set as Default” for this model
    • From the Search Fields, select one or more fields that you would like to search on. Atleast one field should be selected.
    • Click on Publish to publish the Relevance Model

Create a Search Page

The Sitecore Module comes with a plug-and-play search page template that you can use to create your search page in a few minutes. Use the /sitecore/templates/Feature/SearchStax/SearchPage/SearchStaxPage template to create it.

The search page by default connects to a Relevance Model named “Default”. If your model is named anything different, you can modify the Search Page (ViewsSearchStaxPageIndex.cshtml) and provide the model name as shown below.

You just need to publish it to start testing your new search experience:

Computed Fields

The Sitecore Module uses a few computed fields out-of-the-box. These fields improve the search experience of your initial search page, but they can be replaced or removed as your project matures. The module’s computed fields are described in the following sections.

For general information on Sitecore’s computed fields, see https://doc.sitecore.com/en/developers/91/platform-administration-and-architecture/create-a-computed-index-field.html.

ResultTitle

This field contains the title of the result item, based on the Sitecore item DisplayName property. If that is empty, the returned string is its Name property value.

This field is not required by the module to make it work properly. However, it is the field that the module uses as the result template title. If you decide to remove or change, do not forget to change the studio config connector.fields.title property on the /Views/SearchStaxPage/Index.cshtml.

ResultURL

This field contains the result URL. It leverages the native Sitecore MediaManager.GetMediaUrl method for media items to get the item URL. When the item is not a media item, this fields starts by defining the current website context. It uses the indexed item Paths.FullPath property and tries to find a website definition which has the same Database property value and has a RootPath which is a parent item from the current one. Once it finds the current website context, it then leverages the native Sitecore LinkManager.GetItemUrl method to get the item URL.

This field is not required by the module to make it work properly. However, it is the field that is used as the result template clickable URL. If you decide to remove it or change, do not forget to change the studio config connector.fields.url property on the /Views/SearchStaxPage/Index.cshtml.

RenderedContent

This field contains a string value that improves the search relevance of the website. It indexes not only the current item text fields, but also the text fields from every data source present on the <indexedRenderings> configuration list.

In order to add new template ids to this list and make them indexable by this computed field, please edit the <indexedRenderings> node children’s values on the App_Config/Modules/SearchStax/SearchStax.Connector.Provider.config file.

This field is not required by the module to make it work properly. You can remove it from your index if you wish.