1

I am using Sitecore 10.2 with SXA. I have added a patch file for fallback language in solr. When I deploy this patch file,on CM server it works fine but on CD server I get the error. Could not find method: AddIndex.(Screenshot attached).

Please suggest what could be missing. Patch file code:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:search="http://www.sitecore.net/xmlconfig/search/">

    <sitecore search:require="solr">
        <contentSearch>
            <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
                <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>
</configuration>

enter image description here

2
  • 1
    Maybe because you are trying to patch master database/index when it is not present on CD instance? Jan 14, 2023 at 8:53
  • Indeed I missed that. Thanks :) Jan 15, 2023 at 10:08

1 Answer 1

2

CD server should not have access to master index and no configurations for it. To fix this issue you can add role:require="Standalone or ContentManagement" to your master index as below:

<sitecore search:require="solr">
    <contentSearch>
        <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
            <indexes>
                <index id="sitecore_master_index" role:require="Standalone or ContentManagement" >
                    <enableItemLanguageFallback>true</enableItemLanguageFallback>
                    <enableFieldLanguageFallback>true</enableFieldLanguageFallback>
                </index>
                <index id="sitecore_web_index">
                    <enableItemLanguageFallback>true</enableItemLanguageFallback>
                    <enableFieldLanguageFallback>true</enableFieldLanguageFallback>
                </index>
            </indexes>
        </configuration>
    </contentSearch>
</sitecore>
1
  • Indeed I missed that. Thanks :) Jan 15, 2023 at 10:08

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.