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

UsingSynonyms not working for language specific synonyms

$
0
0

Hi,

I have the following synonyms defined in the Episerver find backend:

All langugages: 123 <> training
Dutch: 456 <> training

This is the relevant part of my search code:

            multiSearch.Search<ISearchableTraining, SearchResult>(language, search =>
            {
                var searchQuery = search
                    .For(query)
                    .UsingSynonyms()
                    .ApplyBestBets()
                    .PublishedInCurrentLanguage()
                    .FilterOnCurrentMarket()
                    .ExcludeDeleted()
                    .Filter(x => x.SearchAvailability, x => x.MarketId.Match(currentMarket.MarketId.Value) & x.IsAvailable.Match(true));
                return searchQuery
                    .Take(100)
                    .Track()
                    .Select(x => new SearchResult(iconWidth, iconHeight)
                    {
                        Name = x.Name,
                        Url = x.ContentLink.GetUrl(true),
                        Type = SearchCategoryValue.Trainings,
                        DisplayType = LocalizationService.Current.GetString("/search/type/trainingen"),
                        Icon = x.Icon,
                        Intro = x.Intro,
                        BackgroundColor = x.BackgroundColor
                    });
            });

When the language == Language.Dutch, and the query == "123" then the UsingSynonyms is working as expected.
But when the language == Language.Dutch, and the query == "456" then the UsingSynonyms is NOT working as expected. I get 0 results. I expect to get the same results as when searching for "123".

Why is this not working as expected?

Kind regards,
Niels


Viewing all articles
Browse latest Browse all 6894

Trending Articles