Breaking changes in Find 9
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
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)
Last updated: Jan 23, 2015