Quantcast
Channel: Optimizely Search & Navigation
Viewing all articles
Browse latest Browse all 6894

Unified Search - Statistics Tracking results in error

$
0
0

Hi,

I am using Unified Search and I want it to appear in the Statistics, so added the Track() method.

IEnumerable<UnifiedSearchHit> _SearchResults = searchClient.UnifiedSearch().For(queryString)
.InField(x => ((BasePageData)x).MetaKeywords)
.InField(x => ((BasePageData)x).MetaTitle)
.InField(x => ((BasePageData)x).MetaDescription)
.Track()
.Filter(x => !x.MatchTypeHierarchy(typeof(ImageData))).Filter(y => !y.MatchTypeHierarchy(typeof(ContainerPage)))
.Take(10).Skip((p - 1) * 10).GetResult(hitSpec, false);

The GetResult method in above statement throws exception "String reference not set to an instance of a String.\r\nParameter name: s"

Stacktrace: 

   at System.Text.Encoding.GetBytes(String s)
   at EPiServer.Find.TrackContext.HashString(String toHash)
   at EPiServer.Find.TrackContext..ctor()
   at EPiServer.Find.SearchExtensions.GetProjectedResult[TResult](ISearch`1 search, SearchContext context)
   at EPiServer.Find.SearchExtensions.GetResult(ITypeSearch`1 search, HitSpecification hitSpecification, Boolean filterForPublicSearch)

If I remove the Track() method, it works fine.

But I need to gather the statistics. Can't figure what I am doing wrong. Please help.

Thank you.


Viewing all articles
Browse latest Browse all 6894

Trending Articles