This project is read-only.

Highlighting search results

Topics: General
Nov 11, 2014 at 6:51 PM
Does anyone know how to highlight search terms in search results with Orchard/Lucene?
Nov 11, 2014 at 7:47 PM
You could do this server-side by overriding the Parts.Common.Body.cshtml shape template for example and then replacing the text portion to be rendered with a version that wraps the searched term occurrences with a span element and some css class to hightlight that piece of text.

Another way could be using jQuery and do the text replacement client side.
Marked as answer by thims on 11/20/2014 at 2:20 AM
Nov 18, 2014 at 2:56 PM
Thanks! I'll try to implement the server-side variant.