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

java.lang.Object
  extended by org.apache.jackrabbit.core.query.lucene.IndexingConfigurationImpl
All Implemented Interfaces:
IndexingConfiguration

public class IndexingConfigurationImpl
extends Object
implements IndexingConfiguration

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.
 
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.

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


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