HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityDoc feedbackLog In

Personalized Search & Navigation (formerly Personalized Find) is a personalization service that you can add to Optimizely Search & Navigation as part of the Optimizely Personalization product suite.


Personalized Search & Navigation currently only works with Optimizely Customized Commerce.

## Integration packages

In addition to _Episerver.Find_, these packages are needed for the integration:

  • _EPiServer.Personalization.Commerce_. Integration for product recommendations.

  • _EPiServer.Find.Personalization_. Search & Navigation integration components.

See the [Personalization section](🔗) how to get started with Personalized Search & Navigation.

## Integration components

Personalized Search & Navigation fetches attributes from a personalization service, which contains a list including property name, property value, and boosting. The list will be included as “boosting” with the Search & Navigation service when doing a search, or filtering content.

The boosting changes the generated “score” on content, to make the result personalized. This functionality will have different impact on the result pending on the query, and on what attributes that are returned from the personalization service.

## Configure

To enable retrieval of search attributes, configure the Attribute API. The required attributes are `episerver:personalization.Site` and `episerver:personalization.ClientToken`\*\*. See [Optimizely Product Recommendations](🔗) for information about configuring the Recommendations API.

## Retrieve attributes

Before executing a personalized Search & Navigation query, the attributes must be fetched from the Recommendations API. This is not a quick process, so the attributes must be fetched and stored or cached for fast retrieval _before_ the user needs them. In this way, latency is not adversely affected when a site visitor executes a query or filter.

Attributes can be retrieved in the ways described below.

### Call the Refresh method

You can call the `Refresh` method on an instance of the `EPiServer.Find.Personalization.IPersonalizationClient`. To retrieve the active `EPiServer.Find.Personalization.IPersonalizationClient` instance, call the `Personalization()` extension on `EPiServer.Find.Personalization.IClient`.

### Decorate a controller with RefreshPreferences

You can decorate a controller with an `EPiServer.Find.Personalization.RefreshPreferences` attribute. This gets attributes from the API when any action method on the controller is executed. To avoid unnecessary refreshing, check the `IPreferenceRepository` for attributes first, or use the controller to track if a refresh has already been done for the visitor.

The Recommendations API call is done asynchronously, so has little effect on the time to execute the controller.

After retrieval, the attributes are stored in an `EPiServer.Find.Personalization.IPreferenceRepository`. The default implementation stores the attributes in the session and in a cookie, for fast retrieval during the session or between sessions no longer than 2 days apart.

If you want to override the default, implement `EPiServer.Find.Personalization.IPreferenceRepository` and change the implementation using the conventions during initialization: `IClient.Personalization().Conventions.PreferenceRepository`. The interface has two methods to implement, `Save` and `Load`, which are self explanatory.

## Execute personalized search queries

To enable personalization in Optimizely Search & Navigation queries, add `.UsingPersonalization()` to the query on the search client. The results are scored according to attribute data.