Last updated: Jun 05 2018

Area: Episerver Find, Episerver Personalized Find Applies to versions: 12.6 and higher (Find)

Personalized Find

Personalized Find is a personalization service that you can add to Episerver Find, as part of the Episerver Personalization product suite. This topic describes the native integration for Find, and how to work with search attributes and values provided to the Episerver Find search client to boost search hits.

Note: At this time, Personalized Find only works with Episerver Commerce.

NuGet packages

To install Find Personalization, install these NuGet packages (in addition to Episerver.Find).

See the Personalization section how to get started with Personalized Find.

Configuration

To enable retrieval of search attributes, configure the Attribute API. The required attributes are episerver:personalization.Site and episerver:personalization.ClientToken. See Episerver Recommendations for information about configuring the Recommendations API.

Retrieving attributes

Before executing a personalized find 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.

There are two ways to retrieve attributes:

  • 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 an EPiServer.Find.Personalization.RefreshPreferences attribute. This gets attributes from the API when any action method on the controller is executed (Hint: 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.

Executing personalized Find queries

To enable personalization in Episerver Find queries, add .UsingPersonalization() to the query on the search client. The results are scored according to attribute data.

Example

var result = _client.Search<ProductContent>()
     .For("ferrari")
     .UsingPersonalization()
     .GetContentResult();

Related topics

Comments

It seems that the only package available for EPiServer.Recommendations.Commerce is marked as [Beta] and is locked to Episerver.Commerce.Core 11.2.6. Is EPiSErver.PersonalizationCommerce the updated package?

Hi Drew,

We released the non-beta packages, and they were renamed to EPiSErver.Personalization.Commerce as you said. We recommend to use that new package!

Hi Quan Mai,

I have configured personalization find in my solution and configured to personlaized portel too, This peace of code didn't give me any result too. any thing we missid out to configure ?


Note : my aim is , my site search results show come on the bases  on pesonalization find reslults.

var result = _client.Search<MyPage>()
     .For("ferrari")
     .UsingPersonalization()
     .GetResult();

I honestly don't know. I forward the question to Find team. 

Hi Yesu,

Personalization Find is working with Commerce content and doesn't work with normal CMS content yet.

The Personalization feature will be available soon but I don't know about the time. :)

/Son Do