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.

Standard Highlighter<br />

The standard highlighter (AKA the default highlighter) doesn't require any special indexing parameters on the<br />

fields to highlight. However you can optionally turn on termVectors, termPositions, and termOffsets for<br />

any field to be highlighted. This will avoid having to run documents through the analysis chain at query-time and<br />

will make highlighting significantly faster and use less memory, particularly for large text fields, and even more so<br />

when hl.usePhraseHighlighter is enabled.<br />

Standard Highlighting Parameters<br />

The table below describes <strong>Solr</strong>'s parameters for the Standard highlighter. These parameters can be defined in<br />

the highlight search component, as defaults for the specific request handler, or passed to the request handler<br />

with the query.<br />

Parameter Default Value Description<br />

hl blank (no highlight) When set to true, enables highlighted snippets to be<br />

generated in the query response. If set to false or to<br />

a blank or missing value, disables highlighting.<br />

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

hl.q is specified, the highlighter will use that term<br />

rather than the main query term.<br />

hl.qparser blank Specifies a qparser to use for the hl.q query. If<br />

blank, will use the defType of the overall query.<br />

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

comma- or space-delimited list of fields for which<br />

<strong>Solr</strong> should generate highlighted snippets. If left<br />

blank, highlights the defaultSearchField (or the field<br />

specified the df parameter if used) for the<br />

StandardRequestHandler. For the<br />

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

defaults.<br />

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

'text_*' or even '*' to highlight on all fields where<br />

highlighting is possible. When using '*', consider<br />

adding hl.requireFieldMatch=true.<br />

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

to generate per field. It is possible for any number of<br />

snippets from zero to this value to be generated.<br />

This parameter accepts per-field overrides.<br />

hl.fragsize 100 Specifies the size, in characters, of fragments to<br />

consider for highlighting. 0 indicates that no<br />

fragmenting should be considered and the whole<br />

field value should be used. This parameter accepts<br />

per-field overrides.<br />

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

315

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

Saved successfully!

Ooh no, something went wrong!