Sitecore RichText field not indexing correctly in Solr in Prodcution only

Viewed 198

I have a field whose type is set to Rich text in Sitecore. On lower environments, the values get indexed correctly and HTML text is stored in Solr correctly.

On Production, for all items the HTML gets stripped off completely.

UPDATE: One difference is that in lower environments, we have Solr on Prem and on Production, it is Solr cloud

UPDATE: I have checked the CM and CD servers and all have the field reader for the Body Copy field

UPDATE: This is now happening for all items. Earlier, possibly the other items weren't updated and published and so they showed the HTML correctly?

What could the issue be?

  1. It is only happening on Production

  2. I have validated the config is as expected. The field is Body Copy

       <fieldReaders type="Sitecore.ContentSearch.FieldReaders.FieldReaderMap, Sitecore.ContentSearch">
         <param desc="id">defaultFieldReaderMap</param>
         <mapFieldByTypeName hint="raw:AddFieldReaderByFieldTypeName">
           <fieldReader fieldTypeName="html|rich text"                                       fieldReaderType="Sitecore.ContentSearch.FieldReaders.RichTextFieldReader, Sitecore.ContentSearch" />
         </mapFieldByTypeName>
               <mapFieldByFieldName hint="raw:AddFieldReaderByFieldName">
                   <fieldReader fieldName="Body Copy" fieldReaderType="Sitecore.ContentSearch.FieldReaders.DefaultFieldReader, Sitecore.ContentSearch" />
               </mapFieldByFieldName>
       </fieldReaders>
    
  3. It is now happening for all the content

  • I have resolved the HTML errors in the fields that reported HTML errors but that didn't fix it either.
1 Answers

If its happening uniformly to all fields, then my guess is that it has got to be your SOLR configuration.

Please review the managed-schema.xml document for the relevant SOLR Core on both your test and your production system.

You can do this via the file system (on prem):
i.e. C:\Solr\server\solr\web_index\conf\managed-schema.xml

Or via the SOLR dashboard (cloud and prem):
i.e. https://solr-domain:8983/solr/#/web_index/files?file=managed-schema

I suspect you will find a difference relating to filters.

Please see HTMLStripCharFilterFactory on this link for an example of a filter which would cause the issues you are describing: https://solr.apache.org/guide/8_1/charfilterfactories.html#solr-htmlstripcharfilterfactory

Let me know if that helps at all.

Regards Dean

Related