Sitecore Module 3.0.2

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

Add-On Feature

This is an optional feature that can be added to your SearchStax account. Ask your Account Representative for details.

For perspective on the advantages of the Sitecore Module, see Data Ingestion for Site Search in our blog space.

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 SearchStax Search App!

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

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

One Sitecore Server per SearchStax Search App!

To prevent data corruption and/or bad website results, do not connect two different Sitecore Content Management servers to the same SearchStax Search App.

Install the Sitecore Module

The first step is to contact the SearchStax team and verify you already have a SearchStax Site Search account and App created with a Solr core configured to deal with your Sitecore. 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 Version Package WDP Package
Sitecore 9.1
Sitecore 9.2
SearchStax package for 9.1 and 9.2 WDP package for 9.1 and 9.2
WDP package for 9.1 and 9.2 CD
Sitecore 9.3
Sitecore 10.0
Sitecore 10.1
Sitecore 10.2
Sitecore 10.3
SearchStax package for 9.3 to 10.3 WDP package for 9.3, 10.0, 10,1, 10.2, 10.3 
WDP package for 9.3, 10.0, 10.1, 10.2, 10.3 CD
Sitecore 10.4 SearchStax package for 10.4 WDP package for 10.4
WDP package for 10.4 CD
Sitecore SXA (All versions) SearchStax package for SXA WDP package for SXA
WDP package for SXA CD

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

Control Panel menu displaying Content Editor, Experience Editor, Marketing Control Panel, Media Library, Security Editor, Template Manager, Publish Site...

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

File selection dialog for uploading a Sitecore package, showing the Choose File button and SearchStax-for-Sitecore-1.7.0 file highlighted in the directo...

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

Installation dialog displaying SearchStax-for-Sitecore package version 3.0.0 with package details and Install button.

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:

Installation completion dialog for SearchStax for Sitecore with Configure button highlighted for next steps.

Configure the Sitecore Module

Go to the SearchStax Module Configuration Page

From the Sitecore Launch Pad, click on the Sitecore Module Configuration button under SearchStax Site Search

Sitecore Experience Platform dashboard showing Content Editing and SearchStax Studio modules with Search Analytics highlighted by a red arrow.

This will open up the Site Search for Sitecore configuration page.

Enter Credentials and Select Account and App.

  1. Start by entering your SearchStax Site Search username and password. Then press the Load Accounts button. This will populate the Site Search Account drop down.
  2. Select the appropriate Site Search Account. It’s probable only one account is available, but you might have access to multiple accounts. Once selected, this will populate the available Search Apps within the selected Studio Account.
  3. Select the appropriate Search App.
  4. Once you have selected the above options, then press the Create an Index button.

SearchStax Site Search configuration form with numbered steps: enter username and password, load accounts, select account from dropdown, choose search a...

Configure Site Search for Sitecore

The next page that the configuration will take you to is the Index Properties page for the Search App that you selected in the previous step.

If your Search App uses token authentication, follow the steps below. Token authentication is the default configuration path for current Site Search apps.

If your Search App uses Basic Authentication instead, see Configure Site Search for Sitecore with Basic Authentication.

The Index Properties configuration form for Site Search for Sitecore with fields for Search App Name, Root Items, and Hosted Search Page Password.

  1. Select your root Item(s). This is going to be the Sitecore Path where the Index should start it’s indexing from. You can list multiple root item paths if there are multiple locations within your Sitecore Content tree that content should be searchable from. By default, the module will index every page under /sitecore/content/home/.
  2. (Optional) You are given an opportunity to enter the Hosted Search Page Password. At this point, unless you know what this password is, and you have previously configured it, we can safely skip this field.
  3. Press the Save button. Now move on to the next step.

Configure Site Search for Sitecore with Basic Authentication

Configuration form for Site Search for Sitecore index settings with Search App Name, Root Items, and Solr password fields.

  • Select your root Item(s). This is going to be the Sitecore Path where the Index should start it’s indexing from. You can list multiple root item paths if there are multiple locations within your Sitecore Content tree that content should be searchable from. By default, the module will index every page under /sitecore/content/home/.
  • Read Only Solr Password and Admin Solr Password: These are the “Read-Only API Credentials” and the “Read-Write Search API Credentials” from the Search and Indexing tab of the Site Search > App Settings > All APIs 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).
  • (Optional) You are given an opportunity to enter the Hosted Search Page Password. At this point, unless you know what this password is, and you have previously configured it, you can safely skip this field.
  • Reset Index When Rebuilding: Check this field if you want SearchStax to completely clear your index right before rebuilding it. Keep in mind that doing so your index will be empty during the rebuilding process, which might take minutes, and that your search page will return no results during this period of time.
  • Press the Save button.

After pressing Save you’ll be prompted a confirmation box. Press confirm to allow Sitecore to apply the appropriate configuration files.

Confirmation dialog for creating an index, warning that Sitecore will be restarted and prompting user to confirm or cancel the action.

Validate Index Creation and Populate Managed Schema

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/xp/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.

Control panel showing the Populate Solr Managed Schema option highlighted in the Indexing section.

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

Schema Populate dialog with a list of searchable indexes, showing sitecore_xdb_index_2 checked and highlighted with a red circle, and the Populate butto...

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

Schema Populate dialog confirming successful indexing with result

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.

Indexing Manager dialog showing a list of local search indexes with sitecorerintegrationtest-667 selected for 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:

Indexing Manager dialog showing successful search index rebuild with job details and processing status.

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

Reload the Search App’s Schema from Within the Site Search Dashboard

At this point, we switch from Sitecore to your SearchStax Site Search Dashboard.

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

SearchStax Site Search dashboard with four modules: Sitecore Module Configuration, Search Analytics, Search Management highlighted, and Relevance and Pr...

  1. From within Site Search, select the App you are in the process of setting up.  Site Search > Profile Selector > Apps List.Application selection dropdown menu highlighting the SitecoreApp option with Create and See All action buttons.
  2. Then go to Site Search > App Settings > All APIs, scroll to the bottom of the screen, and press the Reload Schema button.

The App Settings menu with All APIs selected, showing a red arrow pointing to the Reload Schema button in the upper right.

Rebuild the Index

Head back to the Sitecore Control Panel and select Indexing Manager.

Control Panel dashboard displaying Searchstax Site Search and My Settings sections with Security and Indexing categories listed below.

Select the appropriate index and then click the Rebuild button.

Indexing Manager dialog showing local search indexes with checkboxes, index statistics on the right, and Rebuild and Cancel buttons at the bottom.

Create a Search Page

  • Configure Result Fields in Site Search
    • Go to Site Search > Navigation Menu > Search App > Search > Results Configuration
    • Select all fields that you would like to be displayed in Result Items. You can map some of the fields to the Result Cards to show them in a special way. Make sure you have at least one field set up.
    • Click on Publish to publish the Results Configuration.

Results Fields configuration panel showing return field mappings with labels and example results card display.

  • Configure Search Fields in Site Search
    • Go to Site Search > Configurations > Basic Configurations > Search Fields.
    • From the Search Fields, select one or more fields that you would like to search on. At least one field should be selected.
    • Click on Publish.

Site Search configuration panel showing Available Fields on the left and Search Fields on the right with options to move fields between containers.

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/SearchStaxPagetemplate to create it.

Builder panel showing SearchStax configuration fields including SearchStaxIndex, SearchModelDefinition, and SearchModel with their respective dropdown t...

And then use the SearchStax Index field to select which index must be used by this search page when performing queries:

Search item configuration panel displaying SearchStax settings including index configuration, search model definition, and search mode options.

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

Search results page displaying five template items including Content, Home, About, News, and Blog sections with sample descriptions.

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/xp/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 Site Search 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 Site Search 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 any given indexed page rendering, except the renderings on the  configuration list.

To add new rendering ids to this list and remove them from being indexed by this computed field, please edit the < renderedContentFieldExcludedRenderings > node children’s values on the App_Config/Modules/SearchStax/SearchStax.Cloud.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.

Adding a Custom Computed Field

What if you would like to add a custom computed field to the configuration? After the SearchStax index has been created, find the index within [site]/App_Config/Modules/SearchStax/SearchStax.Connector.Provider.config, where [site] is the folder of your inetpub/wwwroot/site. In the section, add an entry for the CustomComputedIndexField:


     YourNameSpace.CustomComputedIndexField,YourNameSpace

Bear in mind that computed index fields are expensive and place a load on the CPU. One should minimize their use.

Articles in this section