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?
Try adding: .InLanguageBranch(currentPage.Language.Name) or maybe grab the Name from ContentLanguage.PreferredCulture.
Please refer the answers of below forum item