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
IndexingConfigurationImpl
implements 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 ornull
if none exist.float
getNodeBoost(NodeState state)
Returns the boost for the node scope fulltext index field.Analyzer
getPropertyAnalyzer(String fieldName)
Returns the analyzer configured for the property with this fieldName (the string representation ,JCR-style name, of the givenName
prefixed withFieldNames.FULLTEXT_PREFIX
)), andnull
if none is configured, or the configured analyzer cannot be found.float
getPropertyBoost(NodeState state, Name propertyName)
Returns the boost value for the given property name.void
init(Element config, QueryHandlerContext context, NamespaceMappings nsMappings)
Initializes the configuration.boolean
isIncludedInNodeScopeIndex(NodeState state, Name propertyName)
Returnstrue
if the property with the given name should be included in the node scope fulltext index.boolean
isIndexed(NodeState state, Name propertyName)
Returnstrue
if the property with the given name is fulltext indexed according to this configuration.void
nodeTypeRegistered(Name ntName)
Called when a node type has been registered.void
nodeTypeReRegistered(Name ntName)
Called when a node type has been re-registered.void
nodeTypesUnregistered(Collection<Name> names)
Called when a set of node types has been unregistered.boolean
useInExcerpt(NodeState state, Name propertyName)
Returnstrue
if 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:
init
in 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 ornull
if none exist.- Specified by:
getAggregateRules
in interfaceIndexingConfiguration
- Returns:
- the configured rules or
null
if none exist.
-
isIndexed
public boolean isIndexed(NodeState state, Name propertyName)
Returnstrue
if the property with the given name is fulltext indexed according to this configuration.- Specified by:
isIndexed
in interfaceIndexingConfiguration
- Parameters:
state
- the node state.propertyName
- the name of a property.- Returns:
true
if the property is fulltext indexed;false
otherwise.
-
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_BOOST
is returned.- Specified by:
getPropertyBoost
in 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:
getNodeBoost
in interfaceIndexingConfiguration
- Parameters:
state
- the node state.- Returns:
- the boost for the node scope fulltext index field.
-
isIncludedInNodeScopeIndex
public boolean isIncludedInNodeScopeIndex(NodeState state, Name propertyName)
Returnstrue
if the property with the given name should be included in the node scope fulltext index. If there is not configuration entry for that properyfalse
is returned.- Specified by:
isIncludedInNodeScopeIndex
in interfaceIndexingConfiguration
- Parameters:
state
- the node state.propertyName
- the name of a property.- Returns:
true
if the property should be included in the node scope fulltext index.
-
useInExcerpt
public boolean useInExcerpt(NodeState state, Name propertyName)
Returnstrue
if the content of the property with the given name should show up in an excerpt. If there is no configuration entry for that propertytrue
is returned.- Specified by:
useInExcerpt
in interfaceIndexingConfiguration
- Parameters:
state
- the node state.propertyName
- the name of a property.- Returns:
true
if the content of the property should be included in an excerpt;false
otherwise.
-
getPropertyAnalyzer
public Analyzer getPropertyAnalyzer(String fieldName)
Returns the analyzer configured for the property with this fieldName (the string representation ,JCR-style name, of the givenName
prefixed withFieldNames.FULLTEXT_PREFIX
)), andnull
if none is configured, or the configured analyzer cannot be found. Ifnull
is returned, the default Analyzer is used.- Specified by:
getPropertyAnalyzer
in interfaceIndexingConfiguration
- Parameters:
fieldName
- the string representation ,JCR-style name, of the givenName
prefixed withFieldNames.FULLTEXT_PREFIX
))- Returns:
- the
analyzer
to use for indexing this property
-
nodeTypeRegistered
public void nodeTypeRegistered(Name ntName)
Description copied from interface:NodeTypeRegistryListener
Called when a node type has been registered.- Specified by:
nodeTypeRegistered
in interfaceNodeTypeRegistryListener
- Parameters:
ntName
- name of the node type that has been registered
-
nodeTypeReRegistered
public void nodeTypeReRegistered(Name ntName)
Description copied from interface:NodeTypeRegistryListener
Called when a node type has been re-registered.- Specified by:
nodeTypeReRegistered
in interfaceNodeTypeRegistryListener
- Parameters:
ntName
- name of the node type that has been registered
-
nodeTypesUnregistered
public void nodeTypesUnregistered(Collection<Name> names)
Description copied from interface:NodeTypeRegistryListener
Called when a set of node types has been unregistered.- Specified by:
nodeTypesUnregistered
in interfaceNodeTypeRegistryListener
- Parameters:
names
- names of the types that have been unregistered
-
-