1

We are on latest version -Sitecore 8.2 update 3

Below is the query we are using to get all composers for language es-es.

It's giving back 3 results. That's partially right as there are only 3 composer items in Sitecore for es-es. But we have language fallback enabled for es-es. So ideally below query should give us 3 (es-es) items + X (en-gb) items as es-es is falling back to en-gb?

var results = context.GetQueryable<ComposerSearchResultItem>(
                            new CultureExecutionContext(Context.Language.CultureInfo))
                            .Where(x => x.TemplateId == composerId)
                            .Select(x => x.ComposerId);

Am I need to pass any new parameter to Sitecore content search to specify this like give me items with language fallback?

1 Answer 1

9

For future use:

I found a solution for this, we need to enable language fallback for master and web indexes like below, and rebuild them. By default, this setting is set to false

    <contentSearch>
        <configuration>
            <indexes>
                <index id="sitecore_master_index">
                    <enableItemLanguageFallback>true</enableItemLanguageFallback>
                    <enableFieldLanguageFallback>true</enableFieldLanguageFallback>
                </index>

                <index id="sitecore_web_index">
                    <enableItemLanguageFallback>true</enableItemLanguageFallback>
                    <enableFieldLanguageFallback>true</enableFieldLanguageFallback>
                </index>
            </indexes>
        </configuration>
    </contentSearch>

</sitecore>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.