How To Personalize Site Search for Sitecore

Any developer working with Site Search for Sitecore can now personalize the search experience for different search audiences by using Site Search “Search Models.”

By combining these tools, you can ensure that the right content reaches the right contacts, for example, by showing, hiding, or adjusting content to suit the viewer.

Creating Search Models

If you want to offer different search experiences, the first step is to go to the Site Search platform and create multiple Relevance Models. Each model has its own field ranking weight, facets, stop words, expansions, sorting options, and so forth. Site Search lets you test the search experience provided by each model. A model has a unique name that can be referenced from Sitecore.

Configuring Sitecore to use Search Models

Now that you have the Site Search models in place, it is time to configure your search page to use them. Since you already know what personalization is and how to achieve that, just go ahead and create a few profiles and pattern cards:

Then open your search page item and find the “Search Model Definition” field:

You need to set the SearchStax search model to be used on each pattern or when a profile card reaches a given value. Keep in mind that the order is very important here, so make sure you reproduce your precedence. Here are three examples using both strategies (card value and patterns):

The result is going to be something like this:

You can use “Sitecore Explorer” view to test it. Open your search page on “Experience Editor” and find the following “Explore” button at the top menu:

Click on it and open the left panel “Onsite Behavior” on the “Profiles” tab:

You can use this panel to give profile cards points to the current visitor, thus forcing the search page to use a different model following the previously established rules. First, run a query in your search page and open your browser’s developer tool to check the network tab. Find the query request and click on it. You can see that “model” parameter being used is the “Default” one, which is the one defined for “Search Novice”.

Now get back to the “Sitecore Explore” view and set some profile card points. Make sure you are following the rules in your search page. Don’t forget about precedence.

Go ahead and check the network tab again after running a query.

As expected, the search page is now using a different search model called “Expert”. This meets what is defined in our rules.

After configuring Sitecore to deal with multiple search models, you can spend some time playing with them to personalize the search experience for each search audience (https://www.searchstax.com/docs/site-search/site-search-model-details/). By doing so, you are making sure the website offers the best search relevance possible.