org.apache.jackrabbit.core.query.lucene
Class IndexingConfigurationImpl

java.lang.Object
  extended by 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
IndexingConfigurationImpl()
           
 
Method Summary
 AggregateRule[] getAggregateRules()
          Returns the configured indexing aggregate rules or null if none exist.
 float getNodeBoost(NodeState state)
          Returns the boost for the node scope fulltext index field.
 org.apache.lucene.analysis.Analyzer getPropertyAnalyzer(String fieldName)
          Returns the analyzer configured for the property with this fieldName (the string representation ,JCR-style name, of the given Name prefixed with FieldNames.FULLTEXT_PREFIX)), and null 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)
          Returns true if the property with the given name should be included in the node scope fulltext index.
 boolean isIndexed(NodeState state, Name propertyName)
          Returns true 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)
          Returns true if the content of the property with the given name should show up in an excerpt.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexingConfigurationImpl

public IndexingConfigurationImpl()
Method Detail

init

public void init(Element config,
                 QueryHandlerContext context,
                 NamespaceMappings nsMappings)
          throws Exception
Initializes the configuration.

Specified by:
init in interface IndexingConfiguration
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 or null if none exist.

Specified by:
getAggregateRules in interface IndexingConfiguration
Returns:
the configured rules or null if none exist.

isIndexed

public boolean isIndexed(NodeState state,
                         Name propertyName)
Returns true if the property with the given name is fulltext indexed according to this configuration.

Specified by:
isIndexed in interface IndexingConfiguration
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 the IndexingConfiguration.DEFAULT_BOOST is returned.

Specified by:
getPropertyBoost in interface IndexingConfiguration
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 interface IndexingConfiguration
Parameters:
state - the node state.
Returns:
the boost for the node scope fulltext index field.

isIncludedInNodeScopeIndex

public boolean isIncludedInNodeScopeIndex(NodeState state,
                                          Name propertyName)
Returns true if the property with the given name should be included in the node scope fulltext index. If there is not configuration entry for that propery false is returned.

Specified by:
isIncludedInNodeScopeIndex in interface IndexingConfiguration
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)
Returns true if the content of the property with the given name should show up in an excerpt. If there is no configuration entry for that property true is returned.

Specified by:
useInExcerpt in interface IndexingConfiguration
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 org.apache.lucene.analysis.Analyzer getPropertyAnalyzer(String fieldName)
Returns the analyzer configured for the property with this fieldName (the string representation ,JCR-style name, of the given Name prefixed with FieldNames.FULLTEXT_PREFIX)), and null if none is configured, or the configured analyzer cannot be found. If null is returned, the default Analyzer is used.

Specified by:
getPropertyAnalyzer in interface IndexingConfiguration
Parameters:
fieldName - the string representation ,JCR-style name, of the given Name prefixed with FieldNames.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 interface NodeTypeRegistryListener
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 interface NodeTypeRegistryListener
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 interface NodeTypeRegistryListener
Parameters:
names - names of the types that have been unregistered


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.