11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

You must also turn on termVectors, termPositions, and termOffsets for each field that will be<br />

highlighted. Lastly, you should use a boundary scanner to prevent the FastVectorHighlighter from truncating your<br />

terms. In most cases, using the breakIterator boundary scanner will give you excellent results. See the<br />

section Using Boundary Scanners with the Fast Vector Highlighter for more details about boundary scanners.<br />

FastVector Highlighter Parameters<br />

The table below describes <strong>Solr</strong>'s parameters for this highlighter, many of which overlap with the standard<br />

highlighter. These parameters can be defined in the highlight search component, as defaults for the specific<br />

request handler, or passed to the request handler with the query.<br />

Parameter Default Description<br />

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

generated in the query response. A false or blank<br />

value disables highlighting.<br />

hl.useFastVectorHighlighter false When set to true, enables the FastVector<br />

Highlighter.<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.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 />

hl.requireFieldMatch false If set to true, highlights terms only if they appear in<br />

the specified field. If false, terms are highlighted in<br />

all requested fields regardless of which field<br />

matched the query.<br />

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

318

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

Saved successfully!

Ooh no, something went wrong!