By default the lucene highlighter highlights the search string using bold tags. Can I provide my own highlighting scheme, using some other color for highlighting?
By default the lucene highlighter highlights the search string using bold tags. Can I
Share
If you’re using just the regular
Highlighter, you can pass it theSimpleHTMLFormatterconstructed with whatever pre and post tags you want:Of course, there are other formatters, like the
GradientFormatter, that will highlight the term with based on a minimum and maximum color determined by score, all which you can set via the constructor. TheSpanGradientFormatterdoes something similar, as well.