public class LuceneSearchHighlighter extends Object implements SearchHighlighter
SearchHighlighter
interface using lucene as underlying
search-engine.Modifier and Type | Field and Description |
---|---|
private org.apache.lucene.analysis.Analyzer |
analyzer
the lucene analyzer
|
private org.apache.lucene.search.highlight.Highlighter |
highlighter
the lucene highlighter
|
Constructor and Description |
---|
LuceneSearchHighlighter(org.apache.lucene.analysis.Analyzer searchAnalyzer,
org.apache.lucene.search.highlight.Formatter formatter,
org.apache.lucene.search.Query searchQuery)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getHighlightedText(String text)
This method highlights the given
text . |
private final org.apache.lucene.search.highlight.Highlighter highlighter
private final org.apache.lucene.analysis.Analyzer analyzer
public LuceneSearchHighlighter(org.apache.lucene.analysis.Analyzer searchAnalyzer, org.apache.lucene.search.highlight.Formatter formatter, org.apache.lucene.search.Query searchQuery)
searchAnalyzer
- is the Analyzer
used by the search-engine
.formatter
- is the formatter used to highlight terms.searchQuery
- is the Query
of the search. Matching terms of this query shall be highlighted.public String getHighlightedText(String text)
text
.getHighlightedText
in interface SearchHighlighter
text
- is the plain text to highlight.SearchHit.getHighlightedText()
Copyright © 2001–2016 mmm-Team. All rights reserved.