|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.solr.util.HighlightingUtils
public class HighlightingUtils
Collection of Utility and Factory methods for Highlighting.
| Constructor Summary | |
|---|---|
HighlightingUtils()
|
|
| Method Summary | |
|---|---|
static NamedList |
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. |
static Formatter |
getFormatter(String fieldName,
SolrQueryRequest request)
Return a formatter appropriate for this field. |
static Fragmenter |
getFragmenter(String fieldName,
SolrQueryRequest request)
Return a fragmenter appropriate for this field. |
static Highlighter |
getHighlighter(Query query,
String fieldName,
SolrQueryRequest request)
Return a Highlighter appropriate for this field. |
static String[] |
getHighlightFields(Query query,
SolrQueryRequest request,
String[] defaultFields)
Return a String array of the fields to be highlighted. |
static int |
getMaxSnippets(String fieldName,
SolrQueryRequest request)
Return the max number of snippets for this field. |
static QueryScorer |
getQueryScorer(Query query,
String fieldName,
SolrQueryRequest request)
Return a QueryScorer suitable for this Query and field. |
static boolean |
isHighlightingEnabled(SolrQueryRequest request)
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 |
| Constructor Detail |
|---|
public HighlightingUtils()
| Method Detail |
|---|
public static boolean isHighlightingEnabled(SolrQueryRequest request)
request - The current SolrQueryRequest
true if highlighting enabled, false if not.
public static Highlighter getHighlighter(Query query,
String fieldName,
SolrQueryRequest request)
query - The current QueryfieldName - The name of the fieldrequest - The current SolrQueryRequest
public static QueryScorer getQueryScorer(Query query,
String fieldName,
SolrQueryRequest request)
query - The current queryfieldName - The name of the fieldrequest - The SolrQueryRequest
public static String[] getHighlightFields(Query query,
SolrQueryRequest request,
String[] defaultFields)
query - The current Queryrequest - The current SolrQueryRequestdefaultFields - Programmatic default highlight fields, used if nothing is specified in the handler config or the request.
public static int getMaxSnippets(String fieldName,
SolrQueryRequest request)
fieldName - The name of the fieldrequest - The current SolrQueryRequest
public static Formatter getFormatter(String fieldName,
SolrQueryRequest request)
fieldName - The name of the fieldrequest - The current SolrQueryRequest
public static Fragmenter getFragmenter(String fieldName,
SolrQueryRequest request)
fieldName - The name of the fieldrequest - The current SolrQueryRequest
public static NamedList doHighlighting(DocList docs,
Query query,
SolrQueryRequest req,
String[] defaultFields)
throws IOException
docs - query resultsquery - the queryreq - the current requestdefaultFields - default list of fields to summarize
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||