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 GapFragmenterSolrInfoBean.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, initializeMetricsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCategory, getMetricNames, getMetricRegistry, getMetricsSnapshot, getName, registerMetricNameclose, getSolrMetricsContext, getUniqueMetricTag, initializeMetricsprotected String defaultPatternRaw
protected Pattern defaultPattern
public void init(NamedList args)
SolrFragmenterinit 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 SolrFragmenterinit in interface NamedListInitializedPlugininit in class HighlightingPluginBasepublic Fragmenter getFragmenter(String fieldName, SolrParams params)
SolrFragmenterFragmenter appropriate for this field.getFragmenter in interface SolrFragmenterfieldName - The name of the fieldparams - The params controlling HighlightingFragmenter.public String getDescription()
SolrInfoBeangetDescription in interface SolrInfoBeangetDescription in class HighlightingPluginBaseCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.