Find.Commerce: "en-GB" stemming isn't working properly

Fixed in

EPiServer.Find.Commerce 9.7.2

Created

Oct 20 2016

Updated

Feb 13 2017

Area

Find

State

Closed, Fixed and tested


Description

Stemming isn't working properly when using the episerver.find.commerce assembly and "en-GB". This seems to have been fixed for the episerver.find.cmsunifiedsearchsetup but not the commerceunifiedsearchsetup:

This fix is already applied for PageData in EPiServer.Find.Cms package CmsUnifiedSearchSetUp class:

UnifiedSearchRegistry.Add<PageData>().PublicSearchFilter((c, ctx) => c.BuildFilter<IContentData>().FilterForVisitor(this.GetLanguage(ctx)));
where GetLanguage correctly reads the "Payload" context parameter:
if (context.Payload.ContainsKey("Culture") && context.Payload["Culture"].IsNotNull())
{
return ((CultureInfo)context.Payload["Culture"]).Name;

But EPiServer.Find.Commerce.CommerceUnifiedSearchSetUp class doesn't use this approach and only reads the context stemming language ignoring the "Payload" parameter:

UnifiedSearchRegistry.Add<EntryContentBase>().PublicSearchFilter((c, ctx) => c.BuildFilter<EPiServer.Core.IContentData>().FilterForVisitor((ctx.Language == null || ctx.Language == Language.None) ? Languages.AllLanguagesSuffix : ctx.Language.FieldSuffix)));

If the Find.Commerce package filter uses the same approach as Find filter for CMS items, the bug with custom cultures will be fixed.