lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Solr Wiki] Update of "HighlightingParameters" by mlissner
Date Wed, 11 Jan 2012 07:10:19 GMT
Dear Wiki user,

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

The "HighlightingParameters" page has been changed by mlissner:
http://wiki.apache.org/solr/HighlightingParameters?action=diff&rev1=35&rev2=36

Comment:
Clarified the terminology for the original highlighter, and added more detail around fragsize.

- Solr provides a collection of [[http://lucene.apache.org/solr/api/org/apache/solr/highlight/package-summary.html|highlighting
utilities]] which can be reused by various Request Handlers to include "highlighted" matches
in field values. The SearchHandler takes advantage of these via the !HighlightingComponent
which support the following parameters.
+ Solr provides a collection of [[http://lucene.apache.org/solr/api/org/apache/solr/highlight/package-summary.html|highlighting
utilities]] which can be reused by various Request Handlers to include "highlighted" matches
and snippets in field values. The SearchHandler takes advantage of these via the !HighlightingComponent
which support the parameters below.
  
  <<Anchor(HowToOverride)>>Some parameters may be overriden on a per-field basis
with the following syntax:
  
@@ -8, +8 @@

  
  eg. `f.contents.hl.snippets=2`
  
- Since [[Solr3.1]], a termvector-based highlighter called !FastVectorHighlighter can be used.
Most of Highlighter's parameters make sense for !FastVectorHighlighter, however, some of them
don't because of the difference of architecture.  See the {{{hl.useFastVectorHighlighter}}}
parameter below.
+ Since [[Solr3.1]], a termvector-based highlighter called !FastVectorHighlighter can be used.
Most of the original Highlighter's parameters make sense for !FastVectorHighlighter, however,
some of them don't because of the difference of architecture.  Where differences arise, they
have been flagged in the descriptions of parameters. If termVectors, termPositions, and termOffsets
are on for the field selected in h.fl,  !DefaultSolrHighlighter uses !FastVectorHighlighter
if the hl.useFastVectorHighlighter parameter set to on. See the {{{hl.useFastVectorHighlighter}}}
parameter below for additional details.
  
  See also http://wiki.apache.org/solr/SolrConfigXml#The_Highlighter_plugin_configuration_section
  
@@ -23, +23 @@

  Set a query request to be highlighted. It overrides q parameter for highlighting. [[SolrQuerySyntax|Solr
query syntax]] is acceptable for this parameter. <!> [[Solr3.5]]
  
  == hl.fl ==
- A comma- or space- delimited list of fields to generate highlighted snippets for.  If left
blank, the fields highlighted for the LuceneQParser are the defaultSearchField (or the `df`
param if used) and for the DisMax parser the `qf` fields are used.
+ A comma- or space- delimited list of fields for which to generate highlighted snippets.
 If left blank, the fields highlighted for the LuceneQParser are the defaultSearchField (or
the `df` param if used) and for the DisMax parser the `qf` fields are used.
  
  A '*' can be used to match field globs, e.g. 'text_*' or even '*' to highlight on all fields
where highlighting is possible. When using '*', consider adding hl.requireFieldMatch=true.
- 
- If the specified field is termVectors=on, termPositions=on and termOffsets=on, !DefaultSolrHighlighter
uses !FastVectorHighlighter if the hl.useFastVectorHighlighter parameter set to on.
  
  The default value is blank.
  
@@ -37, +35 @@

  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). (Highlighter only) This parameter accepts
per-field overrides.
+ The size, in characters, of the snippets (aka fragments) created by the highlighter.  In
the original Highlighter, "`0`" indicates that the whole field value should be used with no
fragmenting. With the FastVectorHighlighter, this can be accomplished by adding the following
to your configuration:
+ 
+ {{{
+ <fragListBuilder name="single" class="solr.highlight.SingleFragListBuilder"/>
+ }}}
+ And then setting fragListBuilder=single.
+ 
+ This parameter accepts per-field overrides.
  
  The default value is "`100`".
  
- If you have a use case where you need to highlight the complete text of a field and need
to highlight every instance of the search term(s) you can set hl.fragsize to a very high value
(whatever it takes to include all the text for the largest value for that field), for example
&hl.fragsize=50000.
+ With the original Highlighter, if you have a use case where you need to highlight the complete
text of a field and need to highlight every instance of the search term(s) you can set hl.fragsize
to a very high value (whatever it takes to include all the text for the largest value for
that field), for example &hl.fragsize=50000.
  
  However, if you want to change fragsize to a value greater than 51200 to return long document
texts with highlighting, you will need to pass the same value to hl.maxAnalyzedChars parameter
too. These two parameters go hand in hand and changing just the hl.fragsize would not be sufficient
for highlighting in very large fields.
  
  == hl.mergeContiguous ==
- Collapse contiguous fragments into a single fragment.  "`true`" indicates contiguous fragments
will be collapsed into single fragment.  This parameter accepts per-field overrides. This
parameter makes sense for Highlighter only.
+ Collapse contiguous fragments into a single fragment.  "`true`" indicates contiguous fragments
will be collapsed into single fragment.  This parameter accepts per-field overrides. This
parameter makes sense for the original Highlighter only.
  
  The default value is "`false`", which is also the backward-compatible setting. <!>
[[Solr1.3]].
  
@@ -56, +61 @@

  The default value is "`false`".
  
  == hl.maxAnalyzedChars ==
- How many characters into a document to look for suitable snippets <!> [[Solr1.3]].
This parameter makes sense for Highlighter only.
+ How many characters into a document to look for suitable snippets <!> [[Solr1.3]].
This parameter makes sense for the original Highlighter only.
  
  The default value is "`51200`".
  
  You can assign a large value to this parameter and use hl.fragsize=0 to return highlighting
in large fields that have size greater than 51200 characters.
  
  == hl.alternateField ==
- If a snippet cannot be generated (due to no terms matching), you can specify a field to
use as the backup/default summary.  This parameter accepts per-field overrides <!> [[Solr1.3]].
+ If a snippet cannot be generated (due to no terms matching), you can specify a field to
use as the fallback.  This parameter accepts per-field overrides <!> [[Solr1.3]].
  
  The default value is to not have a default summary.
  
@@ -73, +78 @@

  The default value is unlimited.
  
  == hl.formatter ==
- Specify a formatter for the highlight output.  Currently the only legal value is "`simple`",
which surrounds a highlighted term with a customizable pre- and post text snippet. This parameter
accepts per-field overrides. This parameter makes sense for Highlighter only.
+ Specify a formatter for the highlight output.  Currently the only legal value is "`simple`",
which surrounds a highlighted term with a customizable pre- and post text snippet. This parameter
accepts per-field overrides. This parameter makes sense for the original Highlighter only.
  
  The default value is "`simple`".
  
  == hl.simple.pre/hl.simple.post ==
  The text which appears before and after a highlighted term when using the `simple` formatter.
This parameter accepts per-field overrides.
  
- The default values are "`<em>`" and "`</em>`" This parameter makes sense for
Highlighter only. Use hl.tag.pre and hl.tag.post for FastVectorHighlighter (see example under
hl.fragmentsBuilder)
+ The default values are "`<em>`" and "`</em>`" This parameter makes sense for
the original Highlighter only. Use hl.tag.pre and hl.tag.post for FastVectorHighlighter (see
example under hl.fragmentsBuilder)
  
  == hl.fragmenter ==
- Specify a text snippet generator for highlighted text.  The standard fragmenter is `gap`
(which is so called because it creates fixed-sized fragments with gaps for multi-valued fields).
 Another option is `regex`, which tries to create fragments that "look like" a certain regular
expression.  This parameter accepts per-field overrides.  <!> [[Solr1.3]] This parameter
makes sense for Highlighter only.
+ Specify a text snippet generator for highlighted text.  The standard fragmenter is `gap`
(which is so called because it creates fixed-sized fragments with gaps for multi-valued fields).
 Another option is `regex`, which tries to create fragments that "look like" a certain regular
expression.  This parameter accepts per-field overrides.  <!> [[Solr1.3]] This parameter
makes sense for the original Highlighter only.
  
  The default value is "`gap`"
  
  == hl.fragListBuilder ==
- Specify the name of SolrFragListBuilder.  <!> [[Solr3.1]] This parameter makes sense
for FastVectorHighlighter only.
+ Specify the name of SolrFragListBuilder.  <!> [[Solr3.1]] This parameter makes sense
for FastVectorHighlighter only. To create a fragSize=0 with the FastVectorHighlighter, use
the SingleFragListBuilder.
+ 
+ This field supports per-field overrides.
  
  == hl.fragmentsBuilder ==
  Specify the name of SolrFragmentsBuilder.  <!> [[Solr3.1]] This parameter makes sense
for FastVectorHighlighter only.
@@ -109, +116 @@

    </lst>
  </fragmentsBuilder>
  }}}
- 
  == hl.boundaryScanner ==
  Specify the name of SolrBoundaryScanner. <!> [[Solr3.5]] This parameter makes sense
for FastVectorHighlighter only.
  
@@ -137, +143 @@

  Use !SpanScorer to highlight phrase terms only when they appear within the query phrase
in the document.  Default is false. <!> [[Solr1.3]].
  
  == hl.highlightMultiTerm ==
- If the !SpanScorer is also being used, enables highlighting for range/wildcard/fuzzy/prefix
queries. Default is false. <!> [[Solr1.4]]. This parameter makes sense for Highlighter
only.
+ If the !SpanScorer is also being used, enables highlighting for range/wildcard/fuzzy/prefix
queries. Default is false. <!> [[Solr1.4]]. This parameter makes sense for the original
Highlighter only.
  
  == hl.regex.slop ==
  Factor by which the regex fragmenter can stray from the ideal fragment size (given by `hl.fragsize`)
to accomodate the regular expression.  For instance, a slop of `0.2` with fragsize of `100`
should yield fragments between `80` and `120` characters in length.  It is usually good to
provide a slightly smaller fragsize when using the `regex` fragmenter.
  
- The default value is "`.6`" This parameter makes sense for Highlighter only.
+ The default value is "`.6`" This parameter makes sense for the original Highlighter only.
  
  == hl.regex.pattern ==
- The regular expression for fragmenting.  This could be used to extract sentences (see example
`solrconfig.xml`) This parameter makes sense for Highlighter only.
+ The regular expression for fragmenting.  This could be used to extract sentences (see example
`solrconfig.xml`) This parameter makes sense for the original Highlighter only.
  
  == hl.regex.maxAnalyzedChars ==
  Only analyze this many characters from a field when using the regex fragmenter (after which,
the fragmenter produces fixed-sized fragments).  Applying a complicated regex to a huge field
is expensive.
  
- The default value is "`10000`". This parameter makes sense for Highlighter only.
+ The default value is "`10000`". This parameter makes sense for the original Highlighter
only.
  

Mime
View raw message