Take the community feedback survey now.

LanguageRoutingFactory for fallback language

Vote:
 

This relates to https://world.optimizely.com/forum/developers-add-ons-forum/Search/Thread-Container/2019/11/unified-search-not-finding-content-in-fallback-language/

I am not able to get search hits from fallback language.

Say I have set fallback for en-CA to en-GB. Navigating and seeing content is no problems.

When I perform a search however, I just get hits on pages/content that are published on current language. I wish to get hits from the fallback language (en-GB) as well.

 

I have implemented a FallbackLanguageRoutingFactory which inherits from LanguageRoutingFactory and an Initialization Module for IndexingModule which adds singleton.

I am not able to get the result as expected.

Could this be due to the demo index I am using?!

 

Using EPiserver.Find.Cms 16.4.1

#337755
Apr 08, 2025 11:49
Vote:
 

When performing a search, the language context of the query matters. If you're searching in en-CA, the search provider might only return results in that language, unless explicitly configured to include fallback.

You might need to manually include fallback languages in your search query. For example:

var searchLanguages = new[] { "en-CA", "en-GB" }; // include fallback
var results = searchClient
    .Search<YourContentType>()
    .Filter(x => x.Language.MatchAny(searchLanguages))
    .GetResult();
 
#340868
Oct 30, 2025 5:52
Vote:
 

Are you using typed or unified search? 

#340871
Oct 30, 2025 20:41
* 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.