public class DefaultSolrHighlighter extends SolrHighlighter implements PluginInfoInitialized
Modifier and Type | Field and Description |
---|---|
protected Map<String,SolrBoundaryScanner> |
boundaryScanners |
protected Map<String,SolrEncoder> |
encoders |
protected Map<String,SolrFormatter> |
formatters |
protected Map<String,SolrFragListBuilder> |
fragListBuilders |
protected Map<String,SolrFragmenter> |
fragmenters |
protected Map<String,SolrFragmentsBuilder> |
fragmentsBuilders |
static org.slf4j.Logger |
log |
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, isHighlightingEnabled
public static org.slf4j.Logger log
protected final Map<String,SolrFormatter> formatters
protected final Map<String,SolrEncoder> encoders
protected final Map<String,SolrFragmenter> fragmenters
protected final Map<String,SolrFragListBuilder> fragListBuilders
protected final Map<String,SolrFragmentsBuilder> fragmentsBuilders
protected final Map<String,SolrBoundaryScanner> boundaryScanners
public DefaultSolrHighlighter()
public DefaultSolrHighlighter(SolrCore solrCore)
public void init(PluginInfo info)
init
in interface PluginInfoInitialized
@Deprecated public void initalize(SolrConfig config)
initalize
in class SolrHighlighter
protected 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 CachingTokenStreamIOException
- If there is a low-level I/O error.protected 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 SolrHighlighter
docs
- query resultsquery
- the queryreq
- the current requestdefaultFields
- default list of fields to summarizeIOException
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.