Package ubic.gemma.core.search
Class DefaultHighlighter
- java.lang.Object
-
- ubic.gemma.core.search.DefaultHighlighter
-
- All Implemented Interfaces:
Highlighter,LuceneHighlighter,OntologyHighlighter
public class DefaultHighlighter extends Object implements LuceneHighlighter, OntologyHighlighter
-
-
Constructor Summary
Constructors Constructor Description DefaultHighlighter()DefaultHighlighter(org.apache.lucene.search.highlight.Formatter formatter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.lucene.search.highlight.FormattergetFormatter()Obtain a formatter for highlights.Map<String,String>highlight(String value, String field)Produce a highlight for a given field.Map<String,String>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.Map<String,String>highlightTerm(String termUri, String termLabel, String field)Produce a highlight for a given ontology term.
-
-
-
Method Detail
-
highlight
public Map<String,String> highlight(String value, String field)
Description copied from interface:HighlighterProduce a highlight for a given field.- Specified by:
highlightin interfaceHighlighter
-
highlightTerm
public Map<String,String> highlightTerm(@Nullable String termUri, String termLabel, String field)
Description copied from interface:OntologyHighlighterProduce a highlight for a given ontology term.- Specified by:
highlightTermin 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:LuceneHighlighterObtain a formatter for highlights.- Specified by:
getFormatterin 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:LuceneHighlighterHighlight a given Lucene document.- Specified by:
highlightDocumentin interfaceLuceneHighlighter
-
-