0

I'm using Sitecore 10.3 and SXA. On a scaled environment setup with 1 CM and 2 CDs, and a separate server for Solr.

I have some computed index fields configured following this blog, I am using them for facets, SXA filters, etc. on my published site, however they are not working on the CDs.

If I open the site using the CM URL, they work fine. They also work fine with the exact same configs on separate standalone environments, it's just the CDs of this environment that pose the issue.

things I've tried that didn't help:

  • repopulated schema
  • republished the site
  • rebuilt SXA master and web indexes
  • Checked that on the published page load, in the networks tab of the console, the api call for the facets goes to "sitecore_sxa_web_index"
  • checked schemas for sitecore_sxa_master_index and sitecore_sxa_web_index they are identical
  • compared schemas to ones on the standalone environment (where everything works fine), identical too
  • checked that the computed fields exists in the sxa_web core schema from the solr admin, it looks as follows: enter image description here
  • checked the Search logs on the CDs, when I try to access pages that use the facets related I get a similar error to below
ERROR Solr Error : [undefined field: "residencytypes"] - Query attempted: [((((_path:(a92d428c5cd84a84b6a37a1ffab23bc0) AND _template:(68f06e499dad40de8f00483e5539d660)) AND (_path:("7be5d7821b054737a1a96e0e2b1d820e") AND searchable_b:("True"))) AND _language:("en")) AND _latestversion:("True")) AND _val_:__boost]
  • checked that this is in schema of sxa web index
<dynamicField name="*_sm" type="string" multiValued="true" indexed="true" stored="true"/>
  • restarted solr service

My config patch looks like the following, I have deployed it on CM and both CDs, I have multiple computed fields but I'm listing just one here in the example:

<?xml version="1.0" encoding="utf-8"?>

<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 role:require="Standalone or ContentManagement or ContentDelivery" search:require="solr">
        <contentSearch>
            <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
                <indexes hint="list:AddIndex">
                    <index id="sitecore_sxa_master_index"
                           type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
                        <configuration>
                            <documentOptions>
                                    <fields>
                                        <field fieldName="eventscategories" returnType="stringCollection"
                                               type="Sitecore.XA.Foundation.Search.ComputedFields.ResolvedLinks,
                            Sitecore.XA.Foundation.Search"
                                               referenceField="category"
                                               contentField="phrase">
                                        </field>
                                    </fields>
                            </documentOptions>
                        </configuration>
                    </index>
                    <index id="sitecore_sxa_web_index"
                           type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
                        <configuration>
                            <documentOptions>
                                <fields>
                                    <field fieldName="eventscategories" returnType="stringCollection"
                                           type="Sitecore.XA.Foundation.Search.ComputedFields.ResolvedLinks,
                            Sitecore.XA.Foundation.Search"
                                           referenceField="category"
                                           contentField="phrase">
                                    </field>
                                </fields>
                            </documentOptions>
                        </configuration>
                    </index>
                </indexes>
            </configuration>
        </contentSearch>
    </sitecore>
</configuration>

I've been stuck on this for days and would really appreciate any pointers as to what I could look into next to fix this.

EDIT 1: changed config to reflect suggested fix (to include ContentDelivery in the config roles), but the problem persists.

2 Answers 2

2

Seems like you have used role:require="Standalone or ContentManagement" but have not used ContentDelivery for content delivery server.

You can check the roles below:

enter image description here

Also more details you can check here https://doc.sitecore.com/xp/en/developers/102/platform-administration-and-architecture/rule-based-configuration.html#the-role-rule-definition

1
  • Hello, I checked the roles are defined as ContentDelivery on the CDs, I also added ContentDelivery in the role of my computedfields config, and tried to rebuild the indexes after that, but it still the issue persists Commented May 29 at 7:11
0

Can you check for role:define settings on Web.config in the Content Delivery Server.

<add key="role:define" value="ContentDelivery" />

You will need to put the same value for role:define settings in the ContentDelivery server on the above configuration file as well, wherein you are adding computed indexes as below.

<sitecore role:require="Standalone or ContentManagement or ContentDelivery" search:require="solr">

Hope this helps!!!

3
  • Hi there, I checked the roles are defined as ContentDelivery on the CDs, I also added ContentDelivery in the role of my computedfields config, and tried to rebuild the indexes after that, but it still didn't work Commented May 29 at 7:10
  • @MieElMansy i just saw you have not added <fields hint="raw:AddComputedIndexField"> inside the computed fields configuration. Moreover can you also check since you are using reference field to create computed field, category field is there in the web index and its content field phrase too is there in the referenced item.
    – ckhanna
    Commented May 29 at 10:44
  • @chkanna thanks for the followup, i added the section you mentioned in the configuration but it didnt help sadly, i also mentioned in my original post that i checked the computed fields appear in solr admin, in the schema and if im querying items that use them they appear in the results Commented May 29 at 14:36

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.