Interface ExcerptProvider
-
- All Known Subinterfaces:
HighlightingExcerptProvider
- All Known Implementing Classes:
AbstractExcerpt,DefaultHTMLExcerpt,DefaultXMLExcerpt,SimpleExcerptProvider,WeightedHTMLExcerpt,WeightedXMLExcerpt
public interface ExcerptProviderExcerptProviderdefines an interface to create an excerpt for a matching node. The format of the excerpt is implementation specific.
-
-
Field Summary
Fields Modifier and Type Field Description static NameREP_EXCERPTName of the rep:excerpt function.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetExcerpt(NodeId id, int maxFragments, int maxFragmentSize)Returns the XML excerpt for the node withid.voidinit(Query query, SearchIndex index)Initializes this excerpt provider.
-
-
-
Field Detail
-
REP_EXCERPT
static final Name REP_EXCERPT
Name of the rep:excerpt function.
-
-
Method Detail
-
init
void init(Query query, SearchIndex index) throws IOException
Initializes this excerpt provider.- Parameters:
query- excerpts will be based on this query.index- provides access to the search index.- Throws:
IOException- if an error occurs while initializing this excerpt provider.
-
getExcerpt
String getExcerpt(NodeId id, int maxFragments, int maxFragmentSize) throws IOException
Returns the XML excerpt for the node withid.- Parameters:
id- a node id.maxFragments- the maximum number of fragments to create.maxFragmentSize- the maximum number of characters in a fragment.- Returns:
- the XML excerpt or
nullif there is no node withid. - Throws:
IOException- if an error occurs while creating the excerpt.
-
-