public class SimpleExcerptProvider extends Object implements ExcerptProvider
SimpleExcerptProvider
is a very simple excerpt provider.
It does not do any highlighting and simply returns up to
maxFragmentSize
characters of string properties for a given
node.#getExcerpt(org.apache.jackrabbit.core.NodeId, int, int)
REP_EXCERPT
Constructor and Description |
---|
SimpleExcerptProvider() |
Modifier and Type | Method and Description |
---|---|
String |
getExcerpt(NodeId id,
int maxFragments,
int maxFragmentSize)
Returns the XML excerpt for the node with
id . |
void |
init(org.apache.lucene.search.Query query,
SearchIndex index)
Initializes this excerpt provider.
|
public void init(org.apache.lucene.search.Query query, SearchIndex index) throws IOException
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.public String getExcerpt(NodeId id, int maxFragments, int maxFragmentSize) throws IOException
id
.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.null
if there is no node with
id
.IOException
- if an error occurs while creating the excerpt.Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.