How to remove block content from xhtml fields in search index with Optimizely cms 12?

Vote:
 

Hi.

We use some blocks inside xhtml fields. By example some layout blocks like “Luft 48px”, that should not be in the search index. Inspired by world.optimizely.com/blogs/Per-Magne-Skuseth/Dates/2016/1/episerver-find-index-blocks-in-xhtmlstring/ it was easy to remove the blocks in CMS 11. But after upgrade to cms 12 this is not working any more. The AsViewedByAnonymous$$string is updated, but the SearchText$$string is not updated.

 So how to remove blocks in xhtml fields from SearchIndex in cms 12?

#290905
Nov 01, 2022 7:47
Vote:
 

I found that I needed to add property SearchText in Basepage to override default indexing.

 

[Ignore]
        public string SearchText
        {
            get
            {
               // custom code
            }
        }
#291044
Edited, Nov 03, 2022 11:30
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.