org.apache.jackrabbit.core.query.lucene
Class SimpleExcerptProvider
java.lang.Object
org.apache.jackrabbit.core.query.lucene.SimpleExcerptProvider
- All Implemented Interfaces:
- ExcerptProvider
public class SimpleExcerptProvider
- extends java.lang.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.
- See Also:
getExcerpt(org.apache.jackrabbit.core.NodeId, int, int)
|
Method Summary |
java.lang.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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleExcerptProvider
public SimpleExcerptProvider()
init
public void init(org.apache.lucene.search.Query query,
SearchIndex index)
throws java.io.IOException
- Initializes this excerpt provider.
- Specified by:
init in interface ExcerptProvider
- Parameters:
query - excerpts will be based on this query.index - provides access to the search index.
- Throws:
java.io.IOException - if an error occurs while initializing this excerpt
provider.
getExcerpt
public java.lang.String getExcerpt(NodeId id,
int maxFragments,
int maxFragmentSize)
throws java.io.IOException
- Returns the XML excerpt for the node with
id.
- Specified by:
getExcerpt in interface ExcerptProvider
- 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
null if there is no node with
id.
- Throws:
java.io.IOException - if an error occurs while creating the excerpt.
Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.