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

UnifiedSearch and Languages

Vote:
 

Hi,

I have a problem getting swedish results with UnifiedSearchFor(query)

ITypeSearch contentquery = SearchClient.Instance.UnifiedSearchFor(query).Take(999);
                
UnifiedSearchResults test = contentquery.GetResult();


If I use Search the swedish results show up. Is there some built in Filter in UnifiedSearch like FilterForVisitor() ?



#123198
Jun 26, 2015 13:16
Vote:
 

Okay so if I have swedish language enabled and search I get only swedish results. :-/ 

Maybe it's not possible to do a UnifiedSearch over all the languages?

#123200
Jun 26, 2015 13:31
Vote:
 

By default UnifiedSearch will query the language branch associated with the current user and apply .FilterForVisitor(language) (and also .FilterOnCurrentSite(), .ExcludeContainerPages() ad .ExcludeContentFolders()). If you want to override the language set by default form the user context you can use:

.OverrideCurrentLanguage(Language.English)

or if you want to query all language branches you can use:

.OverrideCurrentLanguage(Language.None)

/Henriik

#123202
Jun 26, 2015 14:27
Vote:
 

Thank you, I tried it but it did not change anything unfortunately. Still same result. 

I browse the swedish part of site and search gives me swedish results and browsing and searching on the english part of site gives me english hits. 

Same search, different active languages.

#123203
Jun 26, 2015 15:02
Vote:
 

Sorry, You were right ofcourse. Stupid me missed a Filter set in initialization. FilterForVisitor() :-/

#123222
Jun 29, 2015 10:20
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.