Search code examples
asp.netepiserver

EpiServer Find excerpt and XhtmlString search


I've been on this for hours.

I have a page model with a bunch of properties. One of these is MainBody which is of type XhtmlString.

When I override the SearchText property and do a bunch of things to ensure the proper excerpt is returned, when I search for something contained in MainBody I get no results. As if EpiServer.Find doesn't search in that property (for some reason).

When I remove the SearchText override, I can find pages, but the excerpt is a compilation of random fields.

Any help at this point is much appreciated.


Solution

  • SearchText is one of the fields used when doing a UnifiedSearch. So if you override that property and only return some info, then a lot of content will be missing in the actual search.

    If you want you own excerpt, it would probably be better to add your own property for that.