@NotThreadSafe public class HitHighlighter extends Object
This class is not thread safe.
Constructor and Description |
---|
HitHighlighter(org.apache.lucene.search.Query query,
org.apache.lucene.analysis.Analyzer analyzer)
Create a new highlighter that uses the default formatter, and HTML encoding.
|
HitHighlighter(org.apache.lucene.search.Query query,
org.apache.lucene.analysis.Analyzer analyzer,
org.apache.lucene.search.highlight.Formatter formatter)
Create a new highlighter with specified formatter with HTML encoding.
|
HitHighlighter(org.apache.lucene.search.Query query,
org.apache.lucene.analysis.Analyzer analyzer,
org.apache.lucene.search.highlight.Formatter formatter,
org.apache.lucene.search.highlight.Encoder encoder)
Create a new highlighter
|
Modifier and Type | Method and Description |
---|---|
String |
getBestFragments(String text)
Use the Lucene Highlighter directly.
|
String |
getSummary(String text)
Get a summary, suitable for displaying excerpts of search results.
|
String |
highlightText(String text)
Highlights text without fragmenting it.
|
String |
highlightWikiMarkup(String markup)
Highlight text without fragmenting, after stripping wiki markup.
|
void |
setFragmenter(org.apache.lucene.search.highlight.Fragmenter originalFragmenter) |
void |
setNoFragments() |
public HitHighlighter(org.apache.lucene.search.Query query, org.apache.lucene.analysis.Analyzer analyzer)
The output format for hit highlights is:
Lorem ipsum <span class="search-highlight>dolor</span> sit amet
public HitHighlighter(org.apache.lucene.search.Query query, org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.search.highlight.Formatter formatter)
public HitHighlighter(org.apache.lucene.search.Query query, org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.search.highlight.Formatter formatter, org.apache.lucene.search.highlight.Encoder encoder)
public void setFragmenter(org.apache.lucene.search.highlight.Fragmenter originalFragmenter)
public void setNoFragments()
public String getSummary(String text)
public String highlightWikiMarkup(String markup)
Copyright © 2003–2017 Atlassian. All rights reserved.