Package org.opencms.search.documents
Class CmsTermHighlighterHtml
java.lang.Object
org.opencms.search.documents.CmsTermHighlighterHtml
- All Implemented Interfaces:
I_CmsTermHighlighter
Default highlighter implementation used for generation of search excerpts.
- Since:
- 6.0.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetExcerpt
(org.apache.lucene.document.Document doc, CmsSearchIndex index, CmsSearchParameters params, org.apache.lucene.search.Query query, org.apache.lucene.analysis.Analyzer analyzer) Returns an excerpt of the given document related based on the given index and query.
-
Constructor Details
-
CmsTermHighlighterHtml
public CmsTermHighlighterHtml()
-
-
Method Details
-
getExcerpt
public String getExcerpt(org.apache.lucene.document.Document doc, CmsSearchIndex index, CmsSearchParameters params, org.apache.lucene.search.Query query, org.apache.lucene.analysis.Analyzer analyzer) throws IOException, org.apache.lucene.search.highlight.InvalidTokenOffsetsException Description copied from interface:I_CmsTermHighlighter
Returns an excerpt of the given document related based on the given index and query.- Specified by:
getExcerpt
in interfaceI_CmsTermHighlighter
- Parameters:
doc
- the content Lucene document to generate the excerpt forindex
- the index that has been searchedparams
- the current search parametersquery
- the search queryanalyzer
- the analyzer used- Returns:
- an excerpt of the content
- Throws:
IOException
- if something goes wrongorg.apache.lucene.search.highlight.InvalidTokenOffsetsException
- in case of problems with the Lucene tokenizer- See Also:
-