Package ubic.gemma.core.search
Class DefaultHighlighter
java.lang.Object
ubic.gemma.core.search.DefaultHighlighter
- All Implemented Interfaces:
Highlighter
,LuceneHighlighter
,OntologyHighlighter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.lucene.search.highlight.Formatter
Obtain a formatter for highlights.Produce a highlight for a given field.highlightDocument
(org.apache.lucene.document.Document document, org.apache.lucene.search.highlight.Highlighter highlighter, org.apache.lucene.analysis.Analyzer analyzer) Highlight a given Lucene document.highlightTerm
(String termUri, String termLabel, String field) Produce a highlight for a given ontology term.
-
Constructor Details
-
DefaultHighlighter
public DefaultHighlighter() -
DefaultHighlighter
public DefaultHighlighter(org.apache.lucene.search.highlight.Formatter formatter)
-
-
Method Details
-
highlight
Description copied from interface:Highlighter
Produce a highlight for a given field.- Specified by:
highlight
in interfaceHighlighter
-
highlightTerm
Description copied from interface:OntologyHighlighter
Produce a highlight for a given ontology term.- Specified by:
highlightTerm
in interfaceOntologyHighlighter
- Parameters:
termUri
- a URI for the term or null for a full-text termtermLabel
- a label for the termfield
- an object path through which the term was found- Returns:
- a suitable highlight, or null if none is found
-
getFormatter
public org.apache.lucene.search.highlight.Formatter getFormatter()Description copied from interface:LuceneHighlighter
Obtain a formatter for highlights.- Specified by:
getFormatter
in interfaceLuceneHighlighter
-
highlightDocument
public Map<String,String> highlightDocument(org.apache.lucene.document.Document document, org.apache.lucene.search.highlight.Highlighter highlighter, org.apache.lucene.analysis.Analyzer analyzer) Description copied from interface:LuceneHighlighter
Highlight a given Lucene document.- Specified by:
highlightDocument
in interfaceLuceneHighlighter
-