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

UsingSynonyms not working for language specific synonyms

Vote:
 

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

#216433
Feb 06, 2020 9:04
Vote:
 

This issue is also experienced by me.
And a similar issue can be reproduced in 'one way' synonyms (Maybe it is by design, but want to know where it is mentioned)

E.g.

Defined synonyms: (word1 > word2), (word2 > word3).

If I search for 'word1' it will not give results for 'word3'. I expect to have 'word1' + 'word2' + 'word3' results.

#216611
Feb 11, 2020 4:42
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.