Package org.apache.solr.highlight
Class RegexFragmenter
- java.lang.Object
- 
- org.apache.solr.highlight.HighlightingPluginBase
- 
- org.apache.solr.highlight.RegexFragmenter
 
 
- 
- All Implemented Interfaces:
- AutoCloseable,- SolrInfoBean,- SolrFragmenter,- SolrMetricProducer,- NamedListInitializedPlugin
 
 public class RegexFragmenter extends HighlightingPluginBase implements SolrFragmenter Fragmenterthat tries to produce snippets that "look" like a regular expression.solrconfig.xmlparameters:- 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).
 maxAnalyzedCharsis much lower for this fragmenter. After this limit is exhausted, fragments are produced in the same way asGapFragmenter
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoBeanSolrInfoBean.Category, SolrInfoBean.Group
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected PatterndefaultPatternprotected StringdefaultPatternRaw- 
Fields inherited from class org.apache.solr.highlight.HighlightingPluginBasedefaults, metricNames, numRequests, solrMetricsContext
 
- 
 - 
Constructor SummaryConstructors Constructor Description RegexFragmenter()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDescription()Simple one or two line descriptionorg.apache.lucene.search.highlight.FragmentergetFragmenter(String fieldName, org.apache.solr.common.params.SolrParams params)Return aFragmenterappropriate for this field.voidinit(org.apache.solr.common.util.NamedList<?> args)initwill be called just once, immediately after creation.- 
Methods inherited from class org.apache.solr.highlight.HighlightingPluginBasegetCategory, getName, getSolrMetricsContext, initializeMetrics
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.solr.core.SolrInfoBeangetCategory, getName
 - 
Methods inherited from interface org.apache.solr.metrics.SolrMetricProducerclose, getSolrMetricsContext, initializeMetrics
 
- 
 
- 
- 
- 
Method Detail- 
initpublic void init(org.apache.solr.common.util.NamedList<?> args) Description copied from interface:NamedListInitializedPlugininitwill be called just once, immediately after creation.Source of the initialization arguments will typically be solrconfig.xml, but will ultimately depends on the plugin itself - Specified by:
- initin interface- NamedListInitializedPlugin
- Overrides:
- initin class- HighlightingPluginBase
- Parameters:
- args- non-null list of initialization parameters (may be empty)
 
 - 
getFragmenterpublic org.apache.lucene.search.highlight.Fragmenter getFragmenter(String fieldName, org.apache.solr.common.params.SolrParams params) Description copied from interface:SolrFragmenterReturn aFragmenterappropriate for this field.- Specified by:
- getFragmenterin interface- SolrFragmenter
- Parameters:
- fieldName- The name of the field
- params- The params controlling Highlighting
- Returns:
- An appropriate Fragmenter.
 
 - 
getDescriptionpublic String getDescription() Description copied from interface:SolrInfoBeanSimple one or two line description- Specified by:
- getDescriptionin interface- SolrInfoBean
- Specified by:
- getDescriptionin class- HighlightingPluginBase
 
 
- 
 
-