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

Try our conversational search powered by Generative AI!

Search showing Non Translated pages

Vote:
 

Hi,
I have a site that has two languages - English and Welsh.
I am using the SearchClient.Instance.Search(lang); way to get Published content in a specific language using Episerver FIND.
But both languages are coming through and pages that have not been Translated into Welsh are coming through on the welsh page and are showing up as English pages.
Im not sure if I am passing through the language correctly or if I am missing something. But I dont want to show Non-translated pages and I need to show just welsh pages when viewing the site in cy-GB.
Can you help?

#163777
Oct 21, 2016 12:25
Vote:
 

Are you invoking FilterForVisitor() ? That should take care of that, and also handle access rights and publish status.
The (language) parmeter for Search<T>() is only used for stemming options.

#163790
Oct 21, 2016 13:20
Vote:
 

I do use that but the results are still returnung english

#163797
Oct 21, 2016 15:20
Vote:
 

Hi,

I think this "bug" could be due to a mismatch of cultures between .NET and Elastic/Find. Try to pass the language/culture into FilterForVisitor() as well, e.g.:

FilterForVisitor(ContentLanguage.PreferredCulture.ToString())

We hade similar problems when we used specific cultures that was based on English, e.g. en-IN.

#163799
Oct 21, 2016 16:02
* 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.