Class SimpleExcerptProvider

    • Constructor Detail

      • SimpleExcerptProvider

        public SimpleExcerptProvider()
    • Method Detail

      • init

        public void init​( query,
                         SearchIndex index)
                  throws IOException
        Initializes this excerpt provider.
        Specified by:
        init in interface ExcerptProvider
        query - excerpts will be based on this query.
        index - provides access to the search index.
        IOException - if an error occurs while initializing this excerpt provider.
      • getExcerpt

        public String getExcerpt​(NodeId id,
                                 int maxFragments,
                                 int maxFragmentSize)
                          throws IOException
        Returns the XML excerpt for the node with id.
        Specified by:
        getExcerpt in interface ExcerptProvider
        id - a node id.
        maxFragments - the maximum number of fragments to create.
        maxFragmentSize - the maximum number of characters in a fragment.
        the XML excerpt or null if there is no node with id.
        IOException - if an error occurs while creating the excerpt.