EPi find Personalization problem

Vote:
 

Hi Team,

Episerver.find.personalization ver13.2.3

We already using recommended products on our site. Now we have to implement the personalized find but it's not working for me. Please guide how to work with the find personalization.

             System.Threading.Tasks.Task.Factory.StartNew(currentContext => { HttpContext.Current = (HttpContext)currentContext; client.Personalization().Refresh(); }, HttpContext.Current.ApplicationInstance.Context);

                    var result = client.Search<SearchResultItem>()
                                  .For(subQueryText)
                                  .UsingPersonalization()
                                 .Filter(x => x.CatalogId.Match(Convert.ToInt32(GlobalSettings.SnSCatalogId)))
                                 .Filter(x => x.LanguageCode.Match(currentCulture.Name))
                                 .ApplyUserFilter(model.CurrentUser)
                                 .Skip((model.PageNumber - 1) * model.ItemsPerPage)
                                 .Take(model.ItemsPerPage)
                                        .GetResult();

 Keys added

<add key="episerver:tracking.Enabled" value="true" />
<add key="episerver:personalization.BaseApiUrl" value="https://uat.peerius.com/xxxxxx" />
<add key="episerver:personalization.Site" value="xxxx" />
<add key="episerver:personalization.ClientToken" value="xxx" />
<add key="episerver:personalization.AdminToken" value="xxx" />

I didn't get any value in below one(prefData  is empty)

var prefData = _client.Personalization().Conventions.PreferenceRepository.Load();

if (prefData != null) {

var attributes = prefData.Attributes;

}

Advance Thanks

#216928
Edited, Sep 11, 2019 18:59
Vote:
 

David,

I am calling Personalization().Refresh() method too.

#216929
Sep 11, 2019 22:08
Vote:
 

Hi are you calling the Refresh() method or decorating a controller with the RefreshPreferences attribute? One of these is required to get personalised search results:

See ''Retrieving attributes" here: https://world.episerver.com/documentation/developer-guides/find/personalized-find/

#216930
Edited, Sep 11, 2019 20:25
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.