Class HitHighlighter
- java.lang.Object
-
- com.atlassian.confluence.search.summary.HitHighlighter
-
@NotThreadSafe public class HitHighlighter extends Object
Finds search hits in content based on a given Lucene query. Highlights those hits with a formatter.
-
-
Constructor Summary
Constructors Constructor Description HitHighlighter(org.apache.lucene.search.Query query, org.apache.lucene.analysis.Analyzer analyzer)Deprecated.since 7.20, useHitHighlighterFactory.create(String)instead.HitHighlighter(org.apache.lucene.search.Query query, org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.search.highlight.Formatter formatter)Deprecated.since 7.20, useHitHighlighterFactory.create(String)instead.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)Deprecated.since 7.20, useHitHighlighterFactory.create(String)instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StringgetBestFragments(String text)Deprecated.since 7.20, no replacement.StringgetSummary(String text)Get a summary, suitable for displaying excerpts of search results.StringhighlightText(String text)Highlights text without fragmenting it.StringhighlightWikiMarkup(String markup)Deprecated.since 6.13.0, no replacementvoidsetFragmenter(org.apache.lucene.search.highlight.Fragmenter originalFragmenter)Deprecated.since 7.20, no replacement.voidsetNoFragments()Deprecated.since 7.20, no replacement.
-
-
-
Constructor Detail
-
HitHighlighter
@Deprecated public HitHighlighter(org.apache.lucene.search.Query query, org.apache.lucene.analysis.Analyzer analyzer)
Deprecated.since 7.20, useHitHighlighterFactory.create(String)instead.Create a new highlighter that uses the default formatter, and HTML encoding.The output format for hit highlights is:
Lorem ipsum <span class="search-highlight>dolor</span> sit amet
-
HitHighlighter
@Deprecated public HitHighlighter(org.apache.lucene.search.Query query, org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.search.highlight.Formatter formatter)
Deprecated.since 7.20, useHitHighlighterFactory.create(String)instead.Create a new highlighter with specified formatter with HTML encoding.
-
HitHighlighter
@Deprecated 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)
Deprecated.since 7.20, useHitHighlighterFactory.create(String)instead.Create a new highlighter
-
-
Method Detail
-
setFragmenter
@Deprecated public void setFragmenter(org.apache.lucene.search.highlight.Fragmenter originalFragmenter)
Deprecated.since 7.20, no replacement. A default fragmenter will be used.
-
setNoFragments
@Deprecated public void setNoFragments()
Deprecated.since 7.20, no replacement.
-
getSummary
public String getSummary(String text)
Get a summary, suitable for displaying excerpts of search results.- Returns:
- a summary, or an empty string if the summary is null or empty.
-
highlightWikiMarkup
@Deprecated public String highlightWikiMarkup(String markup)
Deprecated.since 6.13.0, no replacementHighlight text without fragmenting, after stripping wiki markup.
-
getBestFragments
@Deprecated public String getBestFragments(String text)
Deprecated.since 7.20, no replacement.Use the Lucene Highlighter directly. Text that doesn't match the query will return an empty string.
-
-