I am using Examine for a search and have descriptions on the pages that match the search terms. So for example someone searches 'flims about dogs', the search brings back everything for 'films', 'about', and 'dogs'. In my case 'dogs' is probably the most relevant word. However, in the search results, I don't want to show 2 paragraphs of text and highlight the word 'dogs' only. I would like to truncate everything before and a certain amount after the word or phrase that matches from the description fields I have displaying.
We are also using Umbraco and Razor.
@foreach (var item in searchResults)
{
<p>@item.GetPropertyValue("Description")</p> //Probably truncate here
}