public class DefaultSolrHighlighter extends SolrHighlighter implements PluginInfoInitialized
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
log |
boundaryScanners, encoders, formatters, fragListBuilders, fragmenters, fragmentsBuilders| Constructor and Description |
|---|
DefaultSolrHighlighter() |
DefaultSolrHighlighter(SolrCore solrCore) |
| Modifier and Type | Method and Description |
|---|---|
NamedList<Object> |
doHighlighting(DocList docs,
Query query,
SolrQueryRequest req,
String[] defaultFields)
Generates a list of Highlighted query fragments for each item in a list
of documents, or returns null if highlighting is disabled.
|
protected Encoder |
getEncoder(String fieldName,
SolrParams params)
Return an
Encoder appropriate for this field. |
protected Formatter |
getFormatter(String fieldName,
SolrParams params)
Return a
Formatter appropriate for this field. |
protected FragListBuilder |
getFragListBuilder(String fieldName,
SolrParams params) |
protected Fragmenter |
getFragmenter(String fieldName,
SolrParams params)
Return a
Fragmenter appropriate for this field. |
protected FragmentsBuilder |
getFragmentsBuilder(String fieldName,
SolrParams params) |
protected Highlighter |
getHighlighter(Query query,
String fieldName,
SolrQueryRequest request)
Return a
Highlighter appropriate for this field. |
protected int |
getMaxSnippets(String fieldName,
SolrParams params)
Return the max number of snippets for this field.
|
protected Highlighter |
getPhraseHighlighter(Query query,
String fieldName,
SolrQueryRequest request,
CachingTokenFilter tokenStream)
Return a phrase
Highlighter appropriate for this field. |
void |
init(PluginInfo info) |
void |
initalize(SolrConfig config)
Deprecated.
|
protected boolean |
isMergeContiguousFragments(String fieldName,
SolrParams params)
Return whether adjacent fragments should be merged.
|
emptyArray, getHighlightFields, isHighlightingEnabledpublic DefaultSolrHighlighter()
public DefaultSolrHighlighter(SolrCore solrCore)
public void init(PluginInfo info)
init in interface PluginInfoInitialized@Deprecated public void initalize(SolrConfig config)
initalize in class SolrHighlighterprotected Highlighter getPhraseHighlighter(Query query, String fieldName, SolrQueryRequest request, CachingTokenFilter tokenStream) throws IOException
Highlighter appropriate for this field.query - The current QueryfieldName - The name of the fieldrequest - The current SolrQueryRequesttokenStream - document text CachingTokenStreamIOExceptionprotected Highlighter getHighlighter(Query query, String fieldName, SolrQueryRequest request)
Highlighter appropriate for this field.query - The current QueryfieldName - The name of the fieldrequest - The current SolrQueryRequestprotected int getMaxSnippets(String fieldName, SolrParams params)
fieldName - The name of the fieldparams - The params controlling Highlightingprotected boolean isMergeContiguousFragments(String fieldName, SolrParams params)
fieldName - The name of the fieldparams - The params controlling Highlightingprotected Formatter getFormatter(String fieldName, SolrParams params)
Formatter appropriate for this field. If a formatter
has not been configured for this field, fall back to the configured
default or the solr default (SimpleHTMLFormatter).fieldName - The name of the fieldparams - The params controlling HighlightingFormatter.protected Encoder getEncoder(String fieldName, SolrParams params)
Encoder appropriate for this field. If an encoder
has not been configured for this field, fall back to the configured
default or the solr default (DefaultEncoder).fieldName - The name of the fieldparams - The params controlling HighlightingEncoder.protected Fragmenter getFragmenter(String fieldName, SolrParams params)
Fragmenter appropriate for this field. If a fragmenter
has not been configured for this field, fall back to the configured
default or the solr default (GapFragmenter).fieldName - The name of the fieldparams - The params controlling HighlightingFragmenter.protected FragListBuilder getFragListBuilder(String fieldName, SolrParams params)
protected FragmentsBuilder getFragmentsBuilder(String fieldName, SolrParams params)
public NamedList<Object> doHighlighting(DocList docs, Query query, SolrQueryRequest req, String[] defaultFields) throws IOException
doHighlighting in class SolrHighlighterdocs - query resultsquery - the queryreq - the current requestdefaultFields - default list of fields to summarizeIOException