public class RegexFragmenter extends HighlightingPluginBase implements SolrFragmenter
Fragmenter
that tries to produce snippets that "look" like a regular
expression.
solrconfig.xml
parameters:
hl.regex.pattern
: regular expression corresponding to "nice" fragments.hl.regex.slop
: how far the fragmenter can stray from the ideal fragment size.
A slop of 0.2 means that the fragmenter can go over or under by 20%.hl.regex.maxAnalyzedChars
: how many characters to apply the
regular expression to (independent from the global highlighter setting).maxAnalyzedChars
is much lower for this
fragmenter. After this limit is exhausted, fragments are produced in the
same way as GapFragmenter
SolrInfoBean.Category, SolrInfoBean.Group
Modifier and Type | Field and Description |
---|---|
protected Pattern |
defaultPattern |
protected String |
defaultPatternRaw |
defaults, metricManager, metricNames, numRequests, registry, registryName
Constructor and Description |
---|
RegexFragmenter() |
Modifier and Type | Method and Description |
---|---|
String |
getDescription()
Simple one or two line description
|
Fragmenter |
getFragmenter(String fieldName,
SolrParams params)
Return a
Fragmenter appropriate for this field. |
void |
init(NamedList args)
init will be called just once, immediately after creation. |
getCategory, getMetricNames, getMetricRegistry, getName, initializeMetrics
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCategory, getMetricNames, getMetricRegistry, getMetricsSnapshot, getName, registerMetricName
close, getSolrMetricsContext, getUniqueMetricTag, initializeMetrics
protected String defaultPatternRaw
protected Pattern defaultPattern
public void init(NamedList args)
SolrFragmenter
init
will be called just once, immediately after creation.
The args are user-level initialization parameters that may be specified when declaring a request handler in solrconfig.xml
init
in interface SolrFragmenter
init
in interface NamedListInitializedPlugin
init
in class HighlightingPluginBase
public Fragmenter getFragmenter(String fieldName, SolrParams params)
SolrFragmenter
Fragmenter
appropriate for this field.getFragmenter
in interface SolrFragmenter
fieldName
- The name of the fieldparams
- The params controlling HighlightingFragmenter
.public String getDescription()
SolrInfoBean
getDescription
in interface SolrInfoBean
getDescription
in class HighlightingPluginBase
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.