ApplySynonyms missing?


The apply synonyms function works in the preview weights function in Find configuration tool. But where can I find the function in the .Net api? I think it should be something like .ApplyBestBets (.ApplySynonyms)

May 28, 2014 21:54

The extension method is called .UsingSynonyms() in EPiServer.Find namespace.

Jun 02, 2014 9:01


My developer index does not support synonyms, grr!. I'm working on to get synonym support, but for now is it possible to check if Synomyns is supported for the index from code?

Jun 02, 2014 11:33

You can check if searchClient.Settings.Admin is true

Jun 02, 2014 11:38
var query = (IQueriedSearch<ISearchContent, QueryStringQuery>)SearchClient.Instance.UnifiedSearchFor(q);
//Use synonyms and weights from admin
            if (SearchClient.Instance.Settings.Admin)
                query = query.UsingSynonyms().UsingUnifiedWeights();

For others with the same question. I had to cast the query to IQueriedSearch to be able to use the extensions UsingSynonyms and UsingUnifiedWeights. Havn't been able to test this code yet because of developer index that do not support synonyms. 

Jun 02, 2014 12:40

This works in production.

Great to have synonyms!

Jun 05, 2014 10:33

Is there a way to get this working for typed search instances also or is the synonyms just for UnifiredSearch?

Jun 24, 2014 13:01

If you are having problems with UsingSynonyms and UnifiedSearch, make sure that you are calling UnifiedSearchFor and UnifiedSearch found in EPiServer.Find.ClientExtensions and not in EPiServer.Find.Cms.ClientExtensions.


Jun 24, 2014 13:22

Ok so UsingSynonyms only works for the UnifiedSearch then.

Jun 24, 2014 14:03

No. As long as you invoke "For" your query should be turned into an IQueriedSearch.

Edited, Jun 24, 2014 14:19

Aaa now I get it thanks.

Guess I need some more coffee =)

Jun 24, 2014 14:24

No problem. My first answer wasn't really an answer to your question either I see now. I guess you're not the only one who need more coffee :-)

Jun 24, 2014 14:27

Hi Per Magne,

Is the issue from your first answer "EPiServer.Find.ClientExtensions and not in EPiServer.Find.Cms.ClientExtensions." still a problem in Find v. 12.x ?

I'm struggelig to get the synonyms and DidYouMean to work. I get best bets.

My code for synonyms:

 return _client.UnifiedSearchFor(query)
                .BoostMatching(x => x.SearchTitle.Match(query), 2)
                .TermsFacetFor(x => x.SearchSection)
                .Filter(p => p.SearchTypeName.Match("Page"))

My code for DidYouMean:

return _client.Statistics().DidYouMean(query, 3).Hits.Select(x => x.Suggestion).ToList();

And yes - I have added the syonyms and did you mean in the admin gui.

Jul 07, 2016 10:12

I think that has been fixed. Is this an an on-premise installation, by any chance?

Aug 12, 2016 21:07


We are working on a multi site with many languages and I only managed to get DidYouMean to work when I configured Related Queries for a specific site and language. For all other configurations did the for "All websites" in "all languages" work. Is this a feature or a bug?

Aug 17, 2016 8:32

Sounds a bit like a bug to me.

However, you could try something like:

SearchClient.Instance.Statistics().DidYouMean(query, 3, ServiceLocator.Current.GetInstance<IStatisticTagsHelper>().AddDefaultTags(null))
Edited, Aug 19, 2016 8:13

I too have same issue with UsingSynonyms(), I am not using UnifiedSearch. where i am getting wrong results in refined search.

when i use .UsingSynonyms() extension with multi words for eg: "Campbell College AND Farm House", getting wrong results instead of decrease the count it is increasing.

When i dont use .UsingSynonyms() extension with multi words for eg: "Campbell College AND Farm House", getting correct results.
and I do not created any Synonyms in CMS. (synonyms are empty).

Jan 17, 2017 15:34
* 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.