Class IndexingConfigurationImpl
- java.lang.Object
-
- org.apache.jackrabbit.core.query.lucene.IndexingConfigurationImpl
-
- All Implemented Interfaces:
NodeTypeRegistryListener,IndexingConfiguration
public class IndexingConfigurationImpl extends Object implements IndexingConfiguration, NodeTypeRegistryListener
IndexingConfigurationImplimplements a concrete indexing configuration.
-
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.core.query.lucene.IndexingConfiguration
DEFAULT_BOOST
-
-
Constructor Summary
Constructors Constructor Description IndexingConfigurationImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AggregateRule[]getAggregateRules()Returns the configured indexing aggregate rules ornullif none exist.floatgetNodeBoost(NodeState state)Returns the boost for the node scope fulltext index field.AnalyzergetPropertyAnalyzer(String fieldName)Returns the analyzer configured for the property with this fieldName (the string representation ,JCR-style name, of the givenNameprefixed withFieldNames.FULLTEXT_PREFIX)), andnullif none is configured, or the configured analyzer cannot be found.floatgetPropertyBoost(NodeState state, Name propertyName)Returns the boost value for the given property name.voidinit(Element config, QueryHandlerContext context, NamespaceMappings nsMappings)Initializes the configuration.booleanisIncludedInNodeScopeIndex(NodeState state, Name propertyName)Returnstrueif the property with the given name should be included in the node scope fulltext index.booleanisIndexed(NodeState state, Name propertyName)Returnstrueif the property with the given name is fulltext indexed according to this configuration.voidnodeTypeRegistered(Name ntName)Called when a node type has been registered.voidnodeTypeReRegistered(Name ntName)Called when a node type has been re-registered.voidnodeTypesUnregistered(Collection<Name> names)Called when a set of node types has been unregistered.booleanuseInExcerpt(NodeState state, Name propertyName)Returnstrueif the content of the property with the given name should show up in an excerpt.
-
-
-
Method Detail
-
init
public void init(Element config, QueryHandlerContext context, NamespaceMappings nsMappings) throws Exception
Initializes the configuration.- Specified by:
initin interfaceIndexingConfiguration- Parameters:
config- the document element of the configuration DOM.context- the context of the query handler.nsMappings- the namespaceMappings.- Throws:
Exception- if initialization fails.
-
getAggregateRules
public AggregateRule[] getAggregateRules()
Returns the configured indexing aggregate rules ornullif none exist.- Specified by:
getAggregateRulesin interfaceIndexingConfiguration- Returns:
- the configured rules or
nullif none exist.
-
isIndexed
public boolean isIndexed(NodeState state, Name propertyName)
Returnstrueif the property with the given name is fulltext indexed according to this configuration.- Specified by:
isIndexedin interfaceIndexingConfiguration- Parameters:
state- the node state.propertyName- the name of a property.- Returns:
trueif the property is fulltext indexed;falseotherwise.
-
getPropertyBoost
public float getPropertyBoost(NodeState state, Name propertyName)
Returns the boost value for the given property name. If there is no configuration entry for the property name theIndexingConfiguration.DEFAULT_BOOSTis returned.- Specified by:
getPropertyBoostin interfaceIndexingConfiguration- Parameters:
state- the node state.propertyName- the name of a property.- Returns:
- the boost value for the property.
-
getNodeBoost
public float getNodeBoost(NodeState state)
Returns the boost for the node scope fulltext index field.- Specified by:
getNodeBoostin interfaceIndexingConfiguration- Parameters:
state- the node state.- Returns:
- the boost for the node scope fulltext index field.
-
isIncludedInNodeScopeIndex
public boolean isIncludedInNodeScopeIndex(NodeState state, Name propertyName)
Returnstrueif the property with the given name should be included in the node scope fulltext index. If there is not configuration entry for that properyfalseis returned.- Specified by:
isIncludedInNodeScopeIndexin interfaceIndexingConfiguration- Parameters:
state- the node state.propertyName- the name of a property.- Returns:
trueif the property should be included in the node scope fulltext index.
-
useInExcerpt
public boolean useInExcerpt(NodeState state, Name propertyName)
Returnstrueif the content of the property with the given name should show up in an excerpt. If there is no configuration entry for that propertytrueis returned.- Specified by:
useInExcerptin interfaceIndexingConfiguration- Parameters:
state- the node state.propertyName- the name of a property.- Returns:
trueif the content of the property should be included in an excerpt;falseotherwise.
-
getPropertyAnalyzer
public Analyzer getPropertyAnalyzer(String fieldName)
Returns the analyzer configured for the property with this fieldName (the string representation ,JCR-style name, of the givenNameprefixed withFieldNames.FULLTEXT_PREFIX)), andnullif none is configured, or the configured analyzer cannot be found. Ifnullis returned, the default Analyzer is used.- Specified by:
getPropertyAnalyzerin interfaceIndexingConfiguration- Parameters:
fieldName- the string representation ,JCR-style name, of the givenNameprefixed withFieldNames.FULLTEXT_PREFIX))- Returns:
- the
analyzerto use for indexing this property
-
nodeTypeRegistered
public void nodeTypeRegistered(Name ntName)
Description copied from interface:NodeTypeRegistryListenerCalled when a node type has been registered.- Specified by:
nodeTypeRegisteredin interfaceNodeTypeRegistryListener- Parameters:
ntName- name of the node type that has been registered
-
nodeTypeReRegistered
public void nodeTypeReRegistered(Name ntName)
Description copied from interface:NodeTypeRegistryListenerCalled when a node type has been re-registered.- Specified by:
nodeTypeReRegisteredin interfaceNodeTypeRegistryListener- Parameters:
ntName- name of the node type that has been registered
-
nodeTypesUnregistered
public void nodeTypesUnregistered(Collection<Name> names)
Description copied from interface:NodeTypeRegistryListenerCalled when a set of node types has been unregistered.- Specified by:
nodeTypesUnregisteredin interfaceNodeTypeRegistryListener- Parameters:
names- names of the types that have been unregistered
-
-