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

ApplySynonyms missing?

Vote:
 

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)

#86717
May 28, 2014 21:54
Vote:
 

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

#86806
Jun 02, 2014 9:01
Vote:
 

Thanks.

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?

#86814
Jun 02, 2014 11:33
Vote:
 

You can check if searchClient.Settings.Admin is true

#86815
Jun 02, 2014 11:38
Vote:
 
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. 

#86824
Jun 02, 2014 12:40
Vote:
 

This works in production.

Great to have synonyms!

#86954
Jun 05, 2014 10:33
Vote:
 

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

#87840
Jun 24, 2014 13:01
Vote:
 

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.

 

#87843
Jun 24, 2014 13:22
Vote:
 

Ok so UsingSynonyms only works for the UnifiedSearch then.

#87846
Jun 24, 2014 14:03
Vote:
 

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

SearchClient.Instance.Search<PageData>().For("Something").UsingSynonyms().GetResult()
#87849
Edited, Jun 24, 2014 14:19
Vote:
 

Aaa now I get it thanks.

Guess I need some more coffee =)

#87851
Jun 24, 2014 14:24
Vote:
 

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 :-)

#87853
Jun 24, 2014 14:27
Vote:
 

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)
                .UsingSynonyms()
                .ApplyBestBets()
                .TermsFacetFor(x => x.SearchSection)
                .Filter(p => p.SearchTypeName.Match("Page"))
                .StaticallyCacheFor(TimeSpan.FromHours(1))
                .Track()
                .GetResult()


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.

#151028
Jul 07, 2016 10:12
Vote:
 

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

#152036
Aug 12, 2016 21:07
Vote:
 

Hi,

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?

#152110
Aug 17, 2016 8:32
Vote:
 

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))
#152191
Edited, Aug 19, 2016 8:13
Vote:
 

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).

#174057
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.