Retrieve html content via examine umbraco

372 Views Asked by At

I like to know how to retrieve content with html tags, I am using following code to retrieve content but it does not include the html tags within the content:

var searchProvider = ExamineManager.Instance.DefaultSearchProvider.Name;
var searchResults = ExamineManager.Instance.SearchProviderCollection[searchProvider].Search(s, true);
System.Text.StringBuilder sb = new StringBuilder();               

        foreach (var c in searchResults)
        {
            sb.Append(string.Format("c.Id:{0} ** FieldNodeName:{1} ** BodyText:{2} <br/> ", c.Id, c.Fields["nodeName"], c.Fields["bodyText"]));
        }

        return sb.ToString();

"Click here to go to the products" is being returned as "Click here to go to the products"

1

There are 1 best solutions below

0
On

Examine removes all HTML elements, so all that is stored is content ( all tags are stripped for indexing ).

You cannot do what you want to do with Examine. If you need the HTML from the node, you need to use the Umbraco API.