Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

LanguageRouting Question

Vote:
 

Hello,

We have a custom data type that we index in FIND in multiple languages.

While indexing we populate field LanguageRouting successfully and when landing on search page with a search term entered, it retrieves the correct results related to current user culture.

However, if user visits search page directly without entering any search term, all items in FIND index are retrieved which lead to duplicate items displayed in search page.

Here is how we build the query:

var query = SearchClient.Instance.Search<CustomDataType>(selectedLanguage)

Any idea how to limit results to current user culture if no search terms were entered?

Thanks!

#204563
Edited, Jun 07, 2019 15:59
Vote:
 

Try adding: .InLanguageBranch(currentPage.Language.Name) or maybe grab the Name from ContentLanguage.PreferredCulture.

#204576
Jun 10, 2019 10:29
* 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.