I was working on a custom search (Full Text Search) web part when at a point I came to know that managed property of a Publishing HTML field is returning just Text (simple) not actual HTML saved in that field. Whereas client requirement was to show formatted text with hyperlinks etc. in the web part. Initially I thought that there might be something wrong with either crawl or managed property for the field. However, I ran some tests and figured out that there is nothing wrong with crawl or managed property. So only other thing was, may be there was something wrong the way I setup/created Publishing HTML field.
For testing purpose, I created a new Publishing HTML field add some contents in that field, create crawl and managed properties then did a search against that new property and I was surprised new property was returning HTML instead of simple text… see screenshots below;
Microsoft.SharePoint.Publishing.Fields.HtmlField field = (Microsoft.SharePoint.Publishing.Fields.HtmlField)list.Fields["Additional Text"]; field.RichText = false; field.Update();
I hope this can save someone’s bunch of time who is facing same kind of problems with publishing fields :).