Class DefaultHTMLExcerpt

  • All Implemented Interfaces:
    ExcerptProvider, HighlightingExcerptProvider

    public class DefaultHTMLExcerpt
    extends AbstractExcerpt
    DefaultHTMLExcerpt creates a HTML excerpt with the following format:
         <span><strong>Jackrabbit</strong> implements both the mandatory XPath and optional SQL <strong>query</strong> syntax.</span>
         <span>Before parsing the XPath <strong>query</strong> in <strong>Jackrabbit</strong>, the statement is surrounded</span>
    • Constructor Detail

      • DefaultHTMLExcerpt

        public DefaultHTMLExcerpt()
    • Method Detail

      • createExcerpt

        protected String createExcerpt​(org.apache.lucene.index.TermPositionVector tpv,
                                       String text,
                                       int maxFragments,
                                       int maxFragmentSize)
                                throws IOException
        Creates an excerpt for the given text using token offset information provided by tpv.
        Specified by:
        createExcerpt in class AbstractExcerpt
        tpv - the term position vector for the fulltext field.
        text - the original text.
        maxFragments - the maximum number of fragments to create.
        maxFragmentSize - the maximum number of characters in a fragment.
        the xml excerpt.
        IOException - if an error occurs while creating the excerpt.