11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Postings Highlighter Parameters<br />

The table below describes <strong>Solr</strong>'s parameters for this highlighter. These parameters can be set as defaults (as in<br />

the examples), or the default values can be changed in the request handler or at query time. Most of the<br />

parameters can be specified per-field (exceptions noted below).<br />

Parameter Default Description<br />

hl<br />

blank (no<br />

highlight)<br />

When set to true, enables highlighted snippets to be generated<br />

in the query response. If set to false or to a blank or missing<br />

value, disables highlighting.<br />

hl.q blank Specifies an overriding query term for highlighting. If hl.q is<br />

specified, the highlighter will use that term rather than the main<br />

query term.<br />

hl.fl blank Specifies a list of fields to highlight. Accepts a comma- or<br />

space-delimited list of fields for which <strong>Solr</strong> should generate<br />

highlighted snippets. If left blank, highlights the<br />

defaultSearchField (or the field specified the df parameter if<br />

used) for the StandardRequestHandler. For the<br />

DisMaxRequestHandler, the qf fields are used as defaults.<br />

A '*' can be used to match field globs, such as 'text_*' or even '*'<br />

to highlight on all fields where highlighting is possible. When<br />

using '*', consider adding hl.requireFieldMatch=true.<br />

hl.snippets 1 Specifies maximum number of highlighted snippets to generate<br />

per field. It is possible for any number of snippets from zero to<br />

this value to be generated. This parameter accepts per-field<br />

overrides.<br />

hl.tag.pre Specifies the text that should appear before a highlighted term.<br />

hl.tag.post Specifies the text that should appear after a highlighted term.<br />

hl.tag.ellipsis "... " Specifies the text that should join two unconnected passages in<br />

the resulting snippet.<br />

hl.maxAnalyzedChars 10000 Specifies the number of characters into a document that <strong>Solr</strong><br />

should look for suitable snippets. This parameter does not<br />

accept per-field overrides.<br />

hl.multiValuedSeparatorChar " " (space) Specifies the logical separator between multi-valued fields.<br />

hl.defaultSummary true If true, a field should have a default summary if highlighting<br />

finds no matching passages.<br />

hl.encoder simple Defines the encoding for the resulting snippet. The value simple<br />

applies no escaping, while html will escape HTML characters in<br />

the text.<br />

hl.score.k1 1.2 Specifies BM25 term frequency normalization parameter 'k1'.<br />

For example, it can be set to "0" to rank passages solely based<br />

on the number of query terms that match.<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

322

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!