org.apache.solr.highlight
Class SolrHighlighter

java.lang.Object
  extended by org.apache.solr.highlight.SolrHighlighter
Direct Known Subclasses:
DefaultSolrHighlighter, PostingsSolrHighlighter

public abstract class SolrHighlighter
extends Object


Field Summary
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 Summary
SolrHighlighter()
           
 
Method Summary
abstract  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  boolean emptyArray(String[] arr)
           
 String[] getHighlightFields(Query query, SolrQueryRequest request, String[] defaultFields)
          Return a String array of the fields to be highlighted.
abstract  void initalize(SolrConfig config)
          Deprecated. 
 boolean isHighlightingEnabled(SolrParams params)
          Check whether Highlighting is enabled for this request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static org.slf4j.Logger log

formatters

protected final Map<String,SolrFormatter> formatters

encoders

protected final Map<String,SolrEncoder> encoders

fragmenters

protected final Map<String,SolrFragmenter> fragmenters

fragListBuilders

protected final Map<String,SolrFragListBuilder> fragListBuilders

fragmentsBuilders

protected final Map<String,SolrFragmentsBuilder> fragmentsBuilders

boundaryScanners

protected final Map<String,SolrBoundaryScanner> boundaryScanners
Constructor Detail

SolrHighlighter

public SolrHighlighter()
Method Detail

initalize

@Deprecated
public abstract void initalize(SolrConfig config)
Deprecated. 


isHighlightingEnabled

public boolean isHighlightingEnabled(SolrParams params)
Check whether Highlighting is enabled for this request.

Parameters:
params - The params controlling Highlighting
Returns:
true if highlighting enabled, false if not.

getHighlightFields

public String[] getHighlightFields(Query query,
                                   SolrQueryRequest request,
                                   String[] defaultFields)
Return a String array of the fields to be highlighted. Falls back to the programatic defaults, or the default search field if the list of fields is not specified in either the handler configuration or the request.

Parameters:
query - The current Query
request - The current SolrQueryRequest
defaultFields - Programmatic default highlight fields, used if nothing is specified in the handler config or the request.

emptyArray

protected boolean emptyArray(String[] arr)

doHighlighting

public abstract NamedList<Object> doHighlighting(DocList docs,
                                                 Query query,
                                                 SolrQueryRequest req,
                                                 String[] defaultFields)
                                          throws IOException
Generates a list of Highlighted query fragments for each item in a list of documents, or returns null if highlighting is disabled.

Parameters:
docs - query results
query - the query
req - the current request
defaultFields - default list of fields to summarize
Returns:
NamedList containing a NamedList for each document, which in turns contains sets (field, summary) pairs.
Throws:
IOException


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