Missing sxacontent_txm in Sitecore SXA Solr Index with Commerce Installed
If you have used Sitecore SXA search components, you are actually using sxacontent_txm field in Solr. It’s a computed field and out of box functionality of SXA that go through all data sources of a page and add all content to the field for search purpose. Pretty handy for setting up your site search quickly.
Above was exactly what I did, however after a certain point, I realised that the site search stopped working and after checking Solr indexes, I found that sxacontent_txm field disappeared.
After some Googling and reading, came across following statements in Sitecore Commerce 9.0 Update 2 and 3’s release notes:
On Azure, the SXA configuration for Azure indexing (\App_Config\Include\Z.Foundation.Overrides\Sitecore.XA.Foundation.Search.Azure.config) has been disabled to allow indexing to work properly in conjunction with Commerce. SXA Search components are not used in the SXA Storefront, but plain SXA sites without commerce will be affected if deployed in the same instance:
- The sxacontent computed field is missing – SXA search will not work at all as it’s using this field to find results.
- Geo-search will not work – no ordering by distance or searching within radius.
- Dynamic search results boosting (boosting rules in the search scope) – some rules will not work as they require computed fields which are defined in this config (on the other hand, there will be nothing to boost as you won’t have search results anyway).
- Field readers for tag and treelist will no longer be there – SXA tags will not work.
References:
As you can see, this explains why the field is gone and SXA search not working is expected actually. Which matches our case because this happened after Sitecore Commerce was installed on top of our Sitecore instance.
Submitted a ticket to Sitecore in the hope that they probably have a patch already(Sometime they do, just trying my luck XD)
So the reason they do this is due to since it go through all the related items, in Commerce context, there could be too large number of catalogue items the crawler goes through which causes performance issues(Not familiar with Commerce yet, so don’t take this part 100%, just take it as rough idea).
And for now, patch or solution is only on the roadmap, however without any timeline yet. The configuration may be enabled if Commerce has less than 100 items or another way is to not use the sxacontent field but apply custom implementations.