public class PostingsSolrHighlighter extends SolrHighlighter implements PluginInfoInitialized
PostingsHighlighter
Example configuration:
<searchComponent class="solr.HighlightComponent" name="highlight">
<highlighting class="org.apache.solr.highlight.PostingsSolrHighlighter"
preTag="<em>"
postTag="</em>"
ellipsis="... "
maxLength=10000/>
</searchComponent>
Notes:
| Modifier and Type | Field and Description |
|---|---|
protected PostingsHighlighter |
highlighter |
boundaryScanners, encoders, formatters, fragListBuilders, fragmenters, fragmentsBuilders, log| Constructor and Description |
|---|
PostingsSolrHighlighter() |
| 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 NamedList<Object> |
encodeSnippets(String[] keys,
String[] fieldNames,
Map<String,String[]> snippets)
Encodes the resulting snippets into a namedlist
|
protected String[] |
getUniqueKeys(SolrIndexSearcher searcher,
TopDocs topDocs)
Retrieves the unique keys for the topdocs to key the results
|
void |
init(PluginInfo info) |
void |
initalize(SolrConfig config) |
protected TopDocs |
toTopDocs(DocList docs)
Converts solr's DocList to a lucene TopDocs
|
emptyArray, getHighlightFields, isHighlightingEnabledprotected PostingsHighlighter highlighter
public void initalize(SolrConfig config)
initalize in class SolrHighlighterpublic void init(PluginInfo info)
init in interface PluginInfoInitializedpublic NamedList<Object> doHighlighting(DocList docs, Query query, SolrQueryRequest req, String[] defaultFields) throws IOException
SolrHighlighterdoHighlighting in class SolrHighlighterdocs - query resultsquery - the queryreq - the current requestdefaultFields - default list of fields to summarizeIOExceptionprotected NamedList<Object> encodeSnippets(String[] keys, String[] fieldNames, Map<String,String[]> snippets)
keys - the document unique keysfieldNames - field names to highlight in the ordersnippets - map from field name to snippet array for the docsprotected String[] getUniqueKeys(SolrIndexSearcher searcher, TopDocs topDocs) throws IOException
IOExceptionCopyright © 2000-2013 Apache Software Foundation. All Rights Reserved.