November Happy Hour will be moved to Thursday December 5th.

Loading...
Area: Optimizely Search & Navigation

Recommended reading 

Introduction

This document describes known issues and breaking changes for this release of EPiServer Find, in relation to previous version 8+, and steps needed to update affected code. 

Known issues

Upgrading issues

When upgrading to EPiServer CMS 8 from a site with version lower than 7.6, it may happen that EPiServer.CMS.Core will be upgraded before EPiServer.Framework. The upgrade may then fail due to that CMS.Core will expect an upgraded Framework. This will be fixed in an upcoming release, but until then this is the work-around:

  • Run "Update-Package EPiServer.Framework"
  • Run "Update-Package"

Issues with tracking and statistics

When using the IStatisticsClient.TrackQuery() method (see below) followed by IStatisticsClient.StatisticsAutocomplete(), no autocomplete suggestions are returned. The same applies to StatisticsDidYouMean() and StatisticsSpellcheck().
An improvement was introduced to StatisticsAutocomplete, StatisticsDidYouMean and StatisticsSpellcheck to filter out suggestions when all the phrases in a tracked query do not match at least one indexed document. These methods add a default tag "andquerymatch" to help filter out the less accurate hits.
  
StatisticsTrack() adds the "andquerymatch" to the tags for the tracked query if all phrases in the query match at least 1 indexed document.
   
There are two workarounds:
    

1. Add "andquerymatch" tag when tracking query:

public void TrackQuery(string query, int nrOfHits, string id)
{
SearchClient.Instance.Statistics().TrackQuery(query, x =>
{
x.Id = id;
x.Tags = ServiceLocator.Current.GetInstance<IStatisticTagsHelper>().GetTags().Concat(new[{ TrackTags.AndQueryMatch.IndexValue() });
x.Query.Hits = nrOfHits;
});
}

2. Use GetAutocomplete() instead of StatisticsAutocomplete()

GetAutocomplete() instead of StatisticsAutocomplete()
var result = statisticsClient.GetAutocomplete(q, x => x.Size = 7);

With GetAutocomplete() you have full control over the tags, and as can be seen here, no tags are specified, therefor not filtering on "andquerymatch" as has become the default in StatisticsAutocomplete.

Breaking changes

Statistics

In order to avoid naming collisions between extensions (Autocomplete/DidYouMean/Spellcheck/Track) in EPiServer.Framework.Statistics and EPiServer.Statistics, the following methods have been renamed:

EPiServer.Find.Statistics.IStatisticsClient

AutocompleteResult Autocomplete(string prefix) => AutocompleteResult GetAutocomplete(string prefix)

AutocompleteResult Autocomplete(string prefix, Action<AutocompleteCommand> commandAction) => AutocompleteResult GetAutocomplete(string prefix, Action<AutocompleteCommand> commandAction)

DidYouMeanResult DidYouMean(string query) => DidYouMeanResult GetDidYouMean(string query)

DidYouMeanResult DidYouMean(string query, Action<DidYouMeanCommand> commandAction) => DidYouMeanResult GetDidYouMean(string query, Action<DidYouMeanCommand> commandAction)

SpellcheckResult Spellcheck(string query) => SpellcheckResult GetSpellcheck(string query)

SpellcheckResult Spellcheck(string query, Action<SpellcheckCommand> commandAction) => SpellcheckResult GetSpellcheck(string query, Action<SpellcheckCommand> commandAction)

 

EPiServer.Find.Statistics.StatisticsClientExtensions

public static AutocompleteResult Autocomplete(this IStatisticsClient client, string prefix, int size) => public static AutocompleteResult StatisticsAutocomplete(this IStatisticsClient client, string prefix, int size = 3, IEnumerable<string> tags = null)

public static DidYouMeanResult DidYouMean(this IStatisticsClient client, string query, int size) => public static DidYouMeanResult StatisticsDidYouMean(this IStatisticsClient client, string query, int size = 1, IEnumerable<string> tags = null)

public static SpellcheckResult Spellcheck(this IStatisticsClient client, string query, int size) => public static SpellcheckResult StatisticsSpellcheck(this IStatisticsClient client, string query, int size = 1, IEnumerable<string> tags = null)

EPiServer.Find.Statistics.TrackExtensions

public static ITypeSearch<TSource> Track<TSource>(this ITypeSearch<TSource> search) => public static ITypeSearch<TSource> StatisticsTrack<TSource>(this ITypeSearch<TSource> search)
public static ISearch<TSource> Track<TSource>(this ISearch<TSource> search) => public static ISearch<TSource> StatisticsTrack<TSource>(this ISearch<TSource> search)
public static ITypeSearch<TSource> Track<TSource>(this ITypeSearch<TSource> search, IEnumerable<string> tags) => public static ITypeSearch<TSource> StatisticsTrack<TSource>(this ITypeSearch<TSource> search, IEnumerable<string> tags)
public static ISearch<TSource> Track<TSource>(this ISearch<TSource> search, IEnumerable<string> tags) => public static ISearch<TSource> StatisticsTrack<TSource>(this ISearch<TSource> search, IEnumerable<string> tags)
After this update the Autocomplete/DidYouMean/Spellcheck/Track-extensions will all reside in the EPiServer.Framework.Statistics namespace and should be used when querying and tracking statistics as these automatically handle site and language filtering.
Do you find this information helpful? Please log in to provide feedback.

Last updated: Jan 23, 2015

Recommended reading