Try our conversational search powered by Generative AI!

Search not returning content in right language for international like french or non english languages

Vote:
 

Search in International site like French or other languages return data for English site only. How to make sure it returns data for the particular language only?

#297707
Mar 04, 2023 21:54
Vote:
 

Have you tried UnifiedSearchFor(term).InLanguageBranch("fr") 

It's probably defaulting to English (because that's the language you marked as default in the CMS > Admin).

#297743
Mar 04, 2023 23:17
Vote:
 

Have you tried using .FilterForVisitor() method on your search queries? It will ensure that your search is in the context of the current site, excludes any expired content or content the user does not have access to.

I would also add that it is better for the content editor if you constrain your types with the .FilterByExactTypes() method on your search query rather than excluding them from the index entirely.  Otherwise the content editor will not be able to find the content items within the CMS search instance.

#297793
Mar 06, 2023 8:56
* 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.