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:
- 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.