|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.core.query.lucene.NodeIndexer
public class NodeIndexer
Creates a lucene Document
object from a Node
.
Field Summary | |
---|---|
protected TextExtractor |
extractor
Content extractor. |
protected NamespaceMappings |
mappings
Namespace mappings to use for indexing. |
protected NodeState |
node
The NodeState of the node to index |
protected ItemStateManager |
stateProvider
The persistent item state provider |
protected boolean |
supportHighlighting
If set to true the fulltext field is stored and and a term
vector is created with offset information. |
Constructor Summary | |
---|---|
NodeIndexer(NodeState node,
ItemStateManager stateProvider,
NamespaceMappings mappings,
TextExtractor extractor)
Creates a new node indexer. |
Method Summary | |
---|---|
protected void |
addBinaryValue(org.apache.lucene.document.Document doc,
String fieldName,
Object internalValue)
Adds the binary value to the document as the named field. |
protected void |
addBooleanValue(org.apache.lucene.document.Document doc,
String fieldName,
Object internalValue)
Adds the string representation of the boolean value to the document as the named field. |
protected void |
addCalendarValue(org.apache.lucene.document.Document doc,
String fieldName,
Object internalValue)
Adds the calendar value to the document as the named field. |
protected void |
addDoubleValue(org.apache.lucene.document.Document doc,
String fieldName,
Object internalValue)
Adds the double value to the document as the named field. |
protected void |
addLongValue(org.apache.lucene.document.Document doc,
String fieldName,
Object internalValue)
Adds the long value to the document as the named field. |
protected void |
addNameValue(org.apache.lucene.document.Document doc,
String fieldName,
Object internalValue)
Adds the name value to the document as the named field. |
protected void |
addPathValue(org.apache.lucene.document.Document doc,
String fieldName,
Object internalValue)
Adds the path value to the document as the named field. |
protected void |
addReferenceValue(org.apache.lucene.document.Document doc,
String fieldName,
Object internalValue)
Adds the reference value to the document as the named field. |
protected void |
addStringValue(org.apache.lucene.document.Document doc,
String fieldName,
Object internalValue)
Deprecated. Use addStringValue(Document, String, Object, boolean) instead. |
protected void |
addStringValue(org.apache.lucene.document.Document doc,
String fieldName,
Object internalValue,
boolean tokenized)
Adds the string value to the document both as the named field and optionally for full text indexing if tokenized is
true . |
protected org.apache.lucene.document.Document |
createDoc()
Creates a lucene Document. |
protected org.apache.lucene.document.Field |
createFulltextField(Reader value)
Creates a fulltext field for the reader value . |
protected org.apache.lucene.document.Field |
createFulltextField(String value)
Creates a fulltext field for the string value . |
NodeId |
getNodeId()
Returns the NodeId of the indexed node. |
protected InternalValue |
getValue(QName name)
Utility method that extracts the first value of the named property of the current node. |
void |
setSupportHighlighting(boolean b)
If set to true additional information is stored in the index
to support highlighting using the rep:excerpt pseudo property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final NodeState node
NodeState
of the node to index
protected final ItemStateManager stateProvider
protected final NamespaceMappings mappings
protected final TextExtractor extractor
protected boolean supportHighlighting
true
the fulltext field is stored and and a term
vector is created with offset information.
Constructor Detail |
---|
public NodeIndexer(NodeState node, ItemStateManager stateProvider, NamespaceMappings mappings, TextExtractor extractor)
node
- the node state to index.stateProvider
- the persistent item state manager to retrieve properties.mappings
- internal namespace mappings.extractor
- content extractorMethod Detail |
---|
public NodeId getNodeId()
NodeId
of the indexed node.
NodeId
of the indexed node.public void setSupportHighlighting(boolean b)
true
additional information is stored in the index
to support highlighting using the rep:excerpt pseudo property.
b
- true
to enable highlighting support.protected org.apache.lucene.document.Document createDoc() throws RepositoryException
RepositoryException
- if an error occurs while reading property
values from the ItemStateProvider
.protected void addBinaryValue(org.apache.lucene.document.Document doc, String fieldName, Object internalValue)
node
is of type nt:resource
and if that is the case, tries to extract text from the binary property
using the extractor
.
doc
- The document to which to add the fieldfieldName
- The name of the field to addinternalValue
- The value for the field to add to the document.protected InternalValue getValue(QName name) throws ItemStateException
null
if the property does
not exist or contains no values.
name
- property name
null
ItemStateException
- if the property can not be accessedprotected void addBooleanValue(org.apache.lucene.document.Document doc, String fieldName, Object internalValue)
doc
- The document to which to add the fieldfieldName
- The name of the field to addinternalValue
- The value for the field to add to the document.protected void addCalendarValue(org.apache.lucene.document.Document doc, String fieldName, Object internalValue)
DateField
class.
doc
- The document to which to add the fieldfieldName
- The name of the field to addinternalValue
- The value for the field to add to the document.protected void addDoubleValue(org.apache.lucene.document.Document doc, String fieldName, Object internalValue)
DoubleField
class.
doc
- The document to which to add the fieldfieldName
- The name of the field to addinternalValue
- The value for the field to add to the document.protected void addLongValue(org.apache.lucene.document.Document doc, String fieldName, Object internalValue)
LongField
class.
doc
- The document to which to add the fieldfieldName
- The name of the field to addinternalValue
- The value for the field to add to the document.protected void addReferenceValue(org.apache.lucene.document.Document doc, String fieldName, Object internalValue)
doc
- The document to which to add the fieldfieldName
- The name of the field to addinternalValue
- The value for the field to add to the document.protected void addPathValue(org.apache.lucene.document.Document doc, String fieldName, Object internalValue)
doc
- The document to which to add the fieldfieldName
- The name of the field to addinternalValue
- The value for the field to add to the document.protected void addStringValue(org.apache.lucene.document.Document doc, String fieldName, Object internalValue)
addStringValue(Document, String, Object, boolean)
instead.
doc
- The document to which to add the fieldfieldName
- The name of the field to addinternalValue
- The value for the field to add to the document.protected void addStringValue(org.apache.lucene.document.Document doc, String fieldName, Object internalValue, boolean tokenized)
tokenized
is
true
.
doc
- The document to which to add the fieldfieldName
- The name of the field to addinternalValue
- The value for the field to add to the document.tokenized
- If true
the string is also tokenized
and fulltext indexed.protected void addNameValue(org.apache.lucene.document.Document doc, String fieldName, Object internalValue)
doc
- The document to which to add the fieldfieldName
- The name of the field to addinternalValue
- The value for the field to add to the document.protected org.apache.lucene.document.Field createFulltextField(String value)
value
.
value
- the string value.
protected org.apache.lucene.document.Field createFulltextField(Reader value)
value
.
value
- the reader value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |