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 2010/04/12 07:41:38 UTC

[Solr Wiki] Update of "HighlightingParameters" by Hayato Ito

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 Hayato Ito.
http://wiki.apache.org/solr/HighlightingParameters?action=diff&rev1=23&rev2=24

--------------------------------------------------

  
  <<Anchor(HowToOverride)>>Some parameters may be overriden on a per-field basis with the following syntax:
  
-    `f.<fieldName>.<originalParam>=<value>`
+  . `f.<fieldName>.<originalParam>=<value>`
  
  eg. `f.contents.hl.snippets=2`
  
  [[http://hudson.zones.apache.org/hudson/job/Lucene-trunk/javadoc/all/org/apache/lucene/search/vectorhighlight/package-summary.html|FastVectorHighlighter]] can be used <!> [[Solr1.5]]. Most of Highlighter's parameters make sense for FastVectorHighlighter, however, some of them don't because of difference of architecture.
  
- 
  <<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.
- 
- 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.  If left blank, the fields highlighted for the StandardRequestHandler are the defaultSearchField (or the `df` param if used) and for the DisMaxRequestHandler 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 FastVectoryHighlighter unless the hl.useHighlighter parameter set to on.
+ If the specified field is termVectors=on, termPositions=on and termOffsets=on, DefaultSolrHighlighter uses FastVectoryHighlighter if the hl.useFastVectorHighlighter parameter set to on.
  
  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 [[#HowToOverride|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`".
@@ -45, +39 @@

  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.
  
  == 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.
  
  The default value is "`false`", which is also the backward-compatible setting. <!> [[Solr1.3]].
  
  == hl.requireFieldMatch ==
- 
  If `true`, then a field will only be highlighted if the query matched in this particular field (normally, terms are highlighted in all requested fields regardless of which field matched the query).  This only takes effect if "`hl.usePhraseHighlighter`" is "`true`".
  
  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.
  
  The default value is "`51200`".
  
  == 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]].
  
  The default value is to not have a default summary.
  
  == hl.maxAlternateFieldLength ==
- 
  If `hl.alternateField` is specified, this parameter specifies the maximum number of characters of the field to return <!> [[Solr1.3]].  Any value less than or equal to `0` means unlimited.
  
  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.
  
  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>`"
  
  == 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.
  
  The default value is "`gap`"
  
  == hl.fragListBuilder ==
- 
  Specify the name of SolrFragListBuilder.  <!> [[Solr1.5]] This parameter makes sense for FastVectorHighlighter only.
  
  == hl.fragmentsBuilder ==
- 
  Specify the name of SolrFragmentsBuilder.  <!> [[Solr1.5]] This parameter makes sense for FastVectorHighlighter only.
  
- == hl.useHighlighter ==
+ == hl.useFastVectorHighlighter ==
- 
- Use (traditional) Highlighter even if the field is termVectors=on, termPositions=on and termOffsets=on. This parameter accepts per-field overrides.  <!> [[Solr1.5]]
+ Use FastVectorHighlighter. FastVectorHighlighter requires the field is termVectors=on, termPositions=on and termOffsets=on. This parameter accepts per-field overrides.  <!> [[Solr1.5]]
  
  The default value is "`false`"
  
  == hl.usePhraseHighlighter ==
- 
  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.
  
  == 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`"
  
  == hl.regex.pattern ==
- 
  The regular expression for fragmenting.  This could be used to extract sentences (see example `solrconfig.xml`)
  
  == 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`".