public class JahiaNodeIndexer
extends org.apache.jackrabbit.core.query.lucene.NodeIndexer
Document object from a Node and use Jahia sepecific definitions for index creation.| Modifier and Type | Field and Description |
|---|---|
static String |
ACL_UUID |
static String |
CHECK_VISIBILITY |
static String |
FACET_HIERARCHY |
static String |
FACET_PREFIX
Prefix for all field names that are facet indexed by property name.
|
protected org.apache.jackrabbit.core.HierarchyManager |
hierarchyMgr
The hierarchy manager
|
static String |
INVALID_LANGUAGES |
static org.apache.jackrabbit.spi.Name |
J_ACE_GRANT |
static org.apache.jackrabbit.spi.Name |
J_ACE_PRINCIPAL |
static org.apache.jackrabbit.spi.Name |
J_ACE_ROLES |
static org.apache.jackrabbit.spi.Name |
J_ACL |
static org.apache.jackrabbit.spi.Name |
J_ACL_INHERITED |
static org.apache.jackrabbit.spi.Name |
J_INVALID_LANGUAGES |
static org.apache.jackrabbit.spi.Name |
J_PUBLISHED |
static org.apache.jackrabbit.spi.Name |
J_VISIBILITY |
protected static org.slf4j.Logger |
logger
The logger instance for this class.
|
protected javax.jcr.NamespaceRegistry |
namespaceRegistry
The persistent namespace registry
|
protected NodeTypeRegistry |
nodeTypeRegistry
The persistent node type registry
|
static String |
PUBLISHED |
protected boolean |
supportSpellchecking
If set to
true the fulltext field is also stored with site/locale suffix |
static String |
TRANSLATED_NODE_PARENT |
static String |
TRANSLATION_LANGUAGE |
| Modifier | Constructor and Description |
|---|---|
protected |
JahiaNodeIndexer(org.apache.jackrabbit.core.state.NodeState node,
org.apache.jackrabbit.core.state.ItemStateManager stateProvider,
org.apache.jackrabbit.core.query.lucene.NamespaceMappings mappings,
Executor executor,
org.apache.tika.parser.Parser parser,
org.apache.jackrabbit.core.query.QueryHandlerContext context,
NodeTypeRegistry typeRegistry,
javax.jcr.NamespaceRegistry nameRegistry) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAclUuid(org.apache.lucene.document.Document doc) |
protected void |
addBinaryValue(org.apache.lucene.document.Document doc,
String fieldName,
org.apache.jackrabbit.core.value.InternalValue internalValue) |
protected void |
addBooleanValue(org.apache.lucene.document.Document doc,
String fieldName,
Object internalValue) |
protected void |
addCalendarValue(org.apache.lucene.document.Document doc,
String fieldName,
Calendar internalValue) |
protected void |
addDoubleValue(org.apache.lucene.document.Document doc,
String fieldName,
double internalValue) |
protected void |
addFacetValue(org.apache.lucene.document.Document doc,
String fieldName,
Object internalValue)
Adds the value to the document both as faceted field which will be indexed with a keyword analyzer which does not modify the term.
|
protected void |
addHierarchicalFacetValue(org.apache.lucene.document.Document doc,
String fieldName,
Object internalValue)
Adds the value to the document both as faceted field which will be indexed with a keyword analyzer which does not modify the term.
|
protected void |
addLongValue(org.apache.lucene.document.Document doc,
String fieldName,
long internalValue) |
protected void |
addNameValue(org.apache.lucene.document.Document doc,
String fieldName,
org.apache.jackrabbit.spi.Name internalValue) |
protected void |
addParentChildRelation(org.apache.lucene.document.Document doc,
org.apache.jackrabbit.core.id.NodeId parentId) |
protected void |
addReferenceValue(org.apache.lucene.document.Document doc,
String fieldName,
org.apache.jackrabbit.core.id.NodeId internalValue,
boolean weak) |
protected void |
addStringValue(org.apache.lucene.document.Document doc,
String fieldName,
String internalValue,
boolean tokenized,
boolean includeInNodeIndex,
float boost,
boolean useInExcerpt)
Adds the string value to the document both as the named field and optionally for full text indexing if
tokenized is
true. |
protected void |
cleanupNodeProperties(org.apache.jackrabbit.core.state.NodeState node) |
org.apache.lucene.document.Document |
createDoc() |
protected org.apache.lucene.document.Field |
createFulltextField(String fieldName,
String value,
boolean store)
Creates a fulltext field for the string
value. |
static JahiaNodeIndexer |
createNodeIndexer(org.apache.jackrabbit.core.state.NodeState node,
org.apache.jackrabbit.core.state.ItemStateManager itemStateManager,
org.apache.jackrabbit.core.query.lucene.NamespaceMappings nsMappings,
Executor executor,
org.apache.tika.parser.Parser parser,
org.apache.jackrabbit.core.query.QueryHandlerContext context) |
protected ExtendedPropertyDefinition |
getExtendedPropertyDefinition(String fieldName) |
protected String |
getFullTextFieldName(String site) |
protected JahiaIndexingConfigurationImpl |
getIndexingConfig() |
protected ExtendedNodeType |
getNodeType() |
protected float |
getPropertyBoost(org.apache.jackrabbit.spi.Name propertyName)
Returns the boost value for the given property name.
|
protected ExtendedPropertyDefinition |
getPropertyDefinition(String fieldName) |
protected ExtendedPropertyDefinition |
getPropertyDefinitionFor(String fieldName,
ExtendedNodeType nodeType,
org.apache.jackrabbit.core.state.NodeState node) |
protected String |
getPropertyName(org.apache.jackrabbit.spi.Name name) |
protected String |
getTypeNameAsString() |
protected static String |
getTypeNameAsString(org.apache.jackrabbit.spi.Name nodeTypeName,
javax.jcr.NamespaceRegistry namespaceRegistry)
Convert name object to jcr-name string
|
boolean |
isAddAclUuidInIndex()
Returns
true if ACL-UUID should be resolved and stored in index. |
protected boolean |
isIncludedInNodeIndex(org.apache.jackrabbit.spi.Name propertyName)
Returns
true if the property with the given name should also be added to the node scope index. |
protected boolean |
isIndexed(org.apache.jackrabbit.spi.Name propertyName)
Returns
true if the property with the given name should be indexed. |
boolean |
isSupportSpellchecking() |
boolean |
isUseOptimizedACEIndexation()
Does this indexer use optimized ACE indexation.
|
protected String |
resolveSite() |
void |
setAddAclUuidInIndex(boolean addAclUuidInIndex) |
void |
setSupportSpellchecking(boolean supportSpellchecking) |
void |
setUseOptimizedACEIndexation(boolean useOptimizedACEIndexation) |
protected boolean |
useInExcerpt(org.apache.jackrabbit.spi.Name propertyName)
Returns
true if the content of the property with the given name should the used to create an excerpt. |
addDecimalValue, addLength, addMVPName, addNodeName, addPathValue, addPropertyName, addStringValue, addStringValue, addStringValue, addURIValue, addValue, addValueProperty, createFieldWithoutNorms, createFulltextField, createFulltextField, createFulltextField, createFulltextField, createFulltextField, getMaxExtractLength, getNodeBoost, getNodeId, getValue, isSupportedMediaType, setIndexFormatVersion, setIndexingConfiguration, setMaxExtractLength, setSupportHighlighting, throwRepositoryExceptionprotected static final org.slf4j.Logger logger
public static final String FACET_PREFIX
public static final String TRANSLATED_NODE_PARENT
public static final String TRANSLATION_LANGUAGE
public static final String ACL_UUID
public static final org.apache.jackrabbit.spi.Name J_ACL
public static final org.apache.jackrabbit.spi.Name J_ACL_INHERITED
public static final org.apache.jackrabbit.spi.Name J_ACE_PRINCIPAL
public static final org.apache.jackrabbit.spi.Name J_ACE_GRANT
public static final org.apache.jackrabbit.spi.Name J_ACE_ROLES
public static final String CHECK_VISIBILITY
public static final org.apache.jackrabbit.spi.Name J_VISIBILITY
public static final String PUBLISHED
public static final org.apache.jackrabbit.spi.Name J_PUBLISHED
public static final String FACET_HIERARCHY
public static final org.apache.jackrabbit.spi.Name J_INVALID_LANGUAGES
public static final String INVALID_LANGUAGES
protected final NodeTypeRegistry nodeTypeRegistry
protected final javax.jcr.NamespaceRegistry namespaceRegistry
protected final org.apache.jackrabbit.core.HierarchyManager hierarchyMgr
protected boolean supportSpellchecking
true the fulltext field is also stored with site/locale suffixprotected JahiaNodeIndexer(org.apache.jackrabbit.core.state.NodeState node,
org.apache.jackrabbit.core.state.ItemStateManager stateProvider,
org.apache.jackrabbit.core.query.lucene.NamespaceMappings mappings,
Executor executor,
org.apache.tika.parser.Parser parser,
org.apache.jackrabbit.core.query.QueryHandlerContext context,
NodeTypeRegistry typeRegistry,
javax.jcr.NamespaceRegistry nameRegistry)
protected String getTypeNameAsString() throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected static String getTypeNameAsString(org.apache.jackrabbit.spi.Name nodeTypeName, javax.jcr.NamespaceRegistry namespaceRegistry) throws javax.jcr.RepositoryException
nodeTypeName - the namenamespaceRegistry - the namespace registryjavax.jcr.RepositoryException - in case of JCR-related errorsprotected boolean useInExcerpt(org.apache.jackrabbit.spi.Name propertyName)
true if the content of the property with the given name should the used to create an excerpt.useInExcerpt in class org.apache.jackrabbit.core.query.lucene.NodeIndexerpropertyName - the name of a property.true if it should be used to create an excerpt; false otherwise.protected String getPropertyName(org.apache.jackrabbit.spi.Name name)
protected String resolveSite()
protected ExtendedNodeType getNodeType()
protected ExtendedPropertyDefinition getExtendedPropertyDefinition(String fieldName)
protected ExtendedPropertyDefinition getPropertyDefinition(String fieldName) throws javax.jcr.RepositoryException, org.apache.jackrabbit.core.state.ItemStateException
javax.jcr.RepositoryExceptionorg.apache.jackrabbit.core.state.ItemStateExceptionprotected ExtendedPropertyDefinition getPropertyDefinitionFor(String fieldName, ExtendedNodeType nodeType, org.apache.jackrabbit.core.state.NodeState node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected float getPropertyBoost(org.apache.jackrabbit.spi.Name propertyName)
getPropertyBoost in class org.apache.jackrabbit.core.query.lucene.NodeIndexerpropertyName - the name of a property.protected boolean isIncludedInNodeIndex(org.apache.jackrabbit.spi.Name propertyName)
true if the property with the given name should also be added to the node scope index.isIncludedInNodeIndex in class org.apache.jackrabbit.core.query.lucene.NodeIndexerpropertyName - the name of a property.true if it should be added to the node scope index; false otherwise.protected boolean isIndexed(org.apache.jackrabbit.spi.Name propertyName)
true if the property with the given name should be indexed.isIndexed in class org.apache.jackrabbit.core.query.lucene.NodeIndexerpropertyName - name of a property.true if the property should be fulltext indexed; false otherwise.protected void addStringValue(org.apache.lucene.document.Document doc,
String fieldName,
String internalValue,
boolean tokenized,
boolean includeInNodeIndex,
float boost,
boolean useInExcerpt)
tokenized is
true.
The Jahia specific functionality is to strip off HTML markup from richtext fields.addStringValue in class org.apache.jackrabbit.core.query.lucene.NodeIndexerdoc - 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.includeInNodeIndex - If true the string is also tokenized and added to the node scope fulltext index.boost - the boost value for this string field.useInExcerpt - If true the string may show up in an excerpt.protected void addFacetValue(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 addHierarchicalFacetValue(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 fieldName, String value, boolean store)
value.value - the string value.store - if the value of the field should be stored.public boolean isSupportSpellchecking()
public void setSupportSpellchecking(boolean supportSpellchecking)
protected void addCalendarValue(org.apache.lucene.document.Document doc,
String fieldName,
Calendar internalValue)
addCalendarValue in class org.apache.jackrabbit.core.query.lucene.NodeIndexerprotected void addBinaryValue(org.apache.lucene.document.Document doc,
String fieldName,
org.apache.jackrabbit.core.value.InternalValue internalValue)
addBinaryValue in class org.apache.jackrabbit.core.query.lucene.NodeIndexerprotected void addBooleanValue(org.apache.lucene.document.Document doc,
String fieldName,
Object internalValue)
addBooleanValue in class org.apache.jackrabbit.core.query.lucene.NodeIndexerprotected void addDoubleValue(org.apache.lucene.document.Document doc,
String fieldName,
double internalValue)
addDoubleValue in class org.apache.jackrabbit.core.query.lucene.NodeIndexerprotected void addLongValue(org.apache.lucene.document.Document doc,
String fieldName,
long internalValue)
addLongValue in class org.apache.jackrabbit.core.query.lucene.NodeIndexerprotected void addReferenceValue(org.apache.lucene.document.Document doc,
String fieldName,
org.apache.jackrabbit.core.id.NodeId internalValue,
boolean weak)
addReferenceValue in class org.apache.jackrabbit.core.query.lucene.NodeIndexerprotected void addNameValue(org.apache.lucene.document.Document doc,
String fieldName,
org.apache.jackrabbit.spi.Name internalValue)
addNameValue in class org.apache.jackrabbit.core.query.lucene.NodeIndexerpublic org.apache.lucene.document.Document createDoc()
throws javax.jcr.RepositoryException
createDoc in class org.apache.jackrabbit.core.query.lucene.NodeIndexerjavax.jcr.RepositoryExceptionprotected void addParentChildRelation(org.apache.lucene.document.Document doc,
org.apache.jackrabbit.core.id.NodeId parentId)
throws org.apache.jackrabbit.core.state.ItemStateException
addParentChildRelation in class org.apache.jackrabbit.core.query.lucene.NodeIndexerorg.apache.jackrabbit.core.state.ItemStateExceptionprotected void cleanupNodeProperties(org.apache.jackrabbit.core.state.NodeState node)
protected JahiaIndexingConfigurationImpl getIndexingConfig()
protected void addAclUuid(org.apache.lucene.document.Document doc)
throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic boolean isAddAclUuidInIndex()
true if ACL-UUID should be resolved and stored in index.
This can have a negative effect on performance, when setting rights on a node,
which has a large subtree using the same rights, as all these nodes will need
to be reindexed. On the other side the advantage is that the queries are faster,
as the user rights are resolved faster.true if ACL-UUID should be resolved and stored in index.public void setAddAclUuidInIndex(boolean addAclUuidInIndex)
public boolean isUseOptimizedACEIndexation()
public void setUseOptimizedACEIndexation(boolean useOptimizedACEIndexation)
public static JahiaNodeIndexer createNodeIndexer(org.apache.jackrabbit.core.state.NodeState node, org.apache.jackrabbit.core.state.ItemStateManager itemStateManager, org.apache.jackrabbit.core.query.lucene.NamespaceMappings nsMappings, Executor executor, org.apache.tika.parser.Parser parser, org.apache.jackrabbit.core.query.QueryHandlerContext context) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.