Solr hit highlighting tag for flex
I'm trying t开发者_运维百科o implement solr hit highlighting using a flex client. Can you guys suggest me a formatter that I could use for this purpose. There are lots of examples out there to do high lighting in client side writing logic to do this, but couldn't find proper solution to tag them from back end
(eg. some words<pretexttag>keyword<posttexttag>some words)
so that it automatically highlight with results. Appreciate if you guys give me any hint. Thanks in advance.
You can set what ever values you want for the highlighting tags in the Solr results using the hl.simple.pre and hl.simple.post options. You can configure these by modifying the solrconfig.xml highlighting standard formatter as follows;
<highlighting>
...
<!-- Configure the standard formatter -->
<formatter name="html" class="org.apache.solr.highlight.HtmlFormatter" default="true">
<lst name="defaults">
<str name="hl.simple.pre"><![CDATA[<pretexttag>]]></str>
<str name="hl.simple.post"><![CDATA[<posttexttag>]]></str>
</lst>
</formatter>
...
</highlighting>
精彩评论