You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2006/09/07 23:26:50 UTC

[Solr Wiki] Update of "HighlightingParameters" by HossMan

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The following page has been changed by HossMan:
http://wiki.apache.org/solr/HighlightingParameters

New page:
Solr provides a collection of [http://incubator.apache.org/solr/docs/api/org/apache/solr/util/HighlightingUtils.html Highlighting Utilities] which can be reused by various Request Handlers to include "highlighted" matches in field values. Both the StandardRequestHandler and the DisMaxRequestHandler currently use these utilities, and support the following parameters.

Some parameters may be overriden on a per-field basis with the following syntax:

   `f.<fieldName>.<originalParam>=<value>`

eg. `f.contents.hl.snippets=2`


[[TableOfContents]]

== hl ==

Set to "`true`" enable highlighted snippets to be generated in the query response.  
Any blank or missing value, or "`false`" will disable highlighting.

The default value is blank.

== hl.fl ==

A comma- or space- delimited list of fields to generate highlighted snippets for.  Currently, the default if this is left blank is the list of fields that are queried (`qf`).

The default value is blank.

== hl.snippets ==

The maximum number of highlighted snippets to generate per field.  Note: it is possible for any number of snippets from zero to this value to be generated.  This parameter accepts per-field overrides.

The default value is "`1`".

== hl.fragsize ==

The size, in characters, of fragments to consider for highlighting.  "`0`" indicates that the whole field value should be used (no fragmenting). This parameter accepts per-field overrides.

The default value is "`100`".

== hl.requireFieldMatch ==

If `true`, then a field will only be highlit if the query matched in this particular field (normally, terms are highlit in all requested field regardless of which field matched the query).

The default value is "`false`".

== hl.formatter ==

Specify a formatter for the highlight output.  Currently the only legal value is "`simple`", which surrounds a highlit term with a customizable pre- and post text snippet. This parameter accepts per-field overrides.

The default value is "`simple`".

== hl.simple.pre/hl.simple.post ==

The text which appears before and after a highlit term when using the `simple` formatter. This parameter accepts per-field overrides.

The default values are "`<em>`" and "`</em>`"