org.apache.solr.highlight
Class RegexFragmenter

java.lang.Object
  extended by org.apache.solr.highlight.HighlightingPluginBase
      extended by org.apache.solr.highlight.RegexFragmenter
All Implemented Interfaces:
SolrInfoMBean, SolrFragmenter, NamedListInitializedPlugin

public class RegexFragmenter
extends HighlightingPluginBase
implements SolrFragmenter

Fragmenter that tries to produce snippets that "look" like a regular expression. solrconfig.xml parameters:

NOTE: the default for maxAnalyzedChars is much lower for this fragmenter. After this limit is exhausted, fragments are produced in the same way as GapFragmenter


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoMBean
SolrInfoMBean.Category
 
Field Summary
protected  Pattern defaultPattern
           
protected  String defaultPatternRaw
           
 
Fields inherited from class org.apache.solr.highlight.HighlightingPluginBase
defaults, numRequests
 
Constructor Summary
RegexFragmenter()
           
 
Method Summary
 String getDescription()
          Simple one or two line description
 Fragmenter getFragmenter(String fieldName, SolrParams params)
          Return a Fragmenter appropriate for this field.
 String getSource()
          CVS Source, SVN Source, etc
 void init(NamedList args)
          init will be called just once, immediately after creation.
 
Methods inherited from class org.apache.solr.highlight.HighlightingPluginBase
getCategory, getDocs, getName, getStatistics, getVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.solr.core.SolrInfoMBean
getCategory, getDocs, getName, getStatistics, getVersion
 

Field Detail

defaultPatternRaw

protected String defaultPatternRaw

defaultPattern

protected Pattern defaultPattern
Constructor Detail

RegexFragmenter

public RegexFragmenter()
Method Detail

init

public void init(NamedList args)
Description copied from interface: 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

Specified by:
init in interface SolrFragmenter
Specified by:
init in interface NamedListInitializedPlugin
Overrides:
init in class HighlightingPluginBase

getFragmenter

public Fragmenter getFragmenter(String fieldName,
                                SolrParams params)
Description copied from interface: SolrFragmenter
Return a Fragmenter appropriate for this field.

Specified by:
getFragmenter in interface SolrFragmenter
Parameters:
fieldName - The name of the field
params - The params controlling Highlighting
Returns:
An appropriate Fragmenter.

getDescription

public String getDescription()
Description copied from interface: SolrInfoMBean
Simple one or two line description

Specified by:
getDescription in interface SolrInfoMBean
Specified by:
getDescription in class HighlightingPluginBase

getSource

public String getSource()
Description copied from interface: SolrInfoMBean
CVS Source, SVN Source, etc

Specified by:
getSource in interface SolrInfoMBean
Specified by:
getSource in class HighlightingPluginBase


Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.