lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <>
Subject Solr has integrated highlighting
Date Sun, 16 Jul 2006 01:14:21 GMT
Those who aren't subscribed to solr-dev may be interested to know that
the lucene highlighter has been integrated into Solr, for both the
standard request handler, and the dismax handler.

See the highlight, highlightFields, and maxSnippets params documented here:

When highlighting is enabled, a new "highlighting" section is added to
responses.  Highlighted terms are marked up like so: <em>term</em>

Below is a sample for query terms ipod, USB
In the real response, the markup tags <em></em> are XML escaped so
each highlight snippet is a single string.

<lst name="highlighting">
  <lst name="IW-02">
    <arr name="features">
      <str>car power adapter for <em>iPod</em>, white</str>
    <arr name="name">
      <str><em>iPod</em> & <em>iPod</em> Mini <em>USB</em>
2.0 Cable</str>
  <lst name="MA147LL/A">
    <arr name="features">
      <str>playback, Upgradeable firmware, <em>USB</em> 2.0
compatibility, Playback speed control, Rechargeable capability</str>
	<arr name="name">
	<str>Apple 60 GB <em>iPod</em> with Video Playback Black</str>

The Lucene version in Solr was just updated to fix a highlighting bug
with overlapping tokens, so you may want to wait for the 7/16 nightly
solr build if you use WordDelimiterFilter.


View raw message