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

java.lang.Object
  extended by org.apache.jackrabbit.core.query.AbstractQueryHandler
      extended by org.apache.jackrabbit.core.query.lucene.SearchIndex
All Implemented Interfaces:
QueryHandler

public class SearchIndex
extends AbstractQueryHandler

Implements a QueryHandler using Lucene.


Nested Class Summary
protected static class SearchIndex.CombinedIndexReader
          Combines multiple CachingMultiIndexReader into a MultiReader with HierarchyResolver support.
 
Field Summary
static int DEFAULT_EXTRACTOR_BACK_LOG
          The default value for property extractorBackLog.
static int DEFAULT_EXTRACTOR_POOL_SIZE
          Deprecated. this value is not used anymore. Instead the default value is calculated as follows: 2 * Runtime.getRuntime().availableProcessors().
static long DEFAULT_EXTRACTOR_TIMEOUT
          The default timeout in milliseconds which is granted to the text extraction process until fulltext indexing is deferred to a background thread.
static int DEFAULT_MAX_FIELD_LENGTH
          the default value for property maxFieldLength.
static int DEFAULT_MAX_MERGE_DOCS
          The default value for property maxMergeDocs.
static int DEFAULT_MERGE_FACTOR
          the default value for property mergeFactor.
static int DEFAULT_MIN_MERGE_DOCS
          The default value for property minMergeDocs.
static List VALID_SYSTEM_INDEX_NODE_TYPE_NAMES
           
 
Constructor Summary
SearchIndex()
          Default constructor.
 
Method Summary
 void addNode(NodeState node)
          Adds the node to the search index.
 void close()
          Closes this QueryHandler and frees resources attached to this handler.
protected  org.apache.lucene.document.Document createDocument(NodeState node, NamespaceMappings nsMappings, IndexFormatVersion indexFormatVersion)
          Creates a lucene Document for a node state using the namespace mappings nsMappings.
 ExcerptProvider createExcerptProvider(org.apache.lucene.search.Query query)
          Creates an excerpt provider for the given query.
 ExecutableQuery createExecutableQuery(SessionImpl session, ItemManager itemMgr, QueryObjectModelTree qomTree)
          Creates a new query by specifying the query object model.
 ExecutableQuery createExecutableQuery(SessionImpl session, ItemManager itemMgr, String statement, String language)
          Creates a new query by specifying the query statement itself and the language in which the query is stated.
protected  IndexingConfiguration createIndexingConfiguration(NamespaceMappings namespaceMappings)
           
protected  org.apache.lucene.search.SortField[] createSortFields(Name[] orderProps, boolean[] orderSpecs)
          Creates the SortFields for the order properties.
protected  SpellChecker createSpellChecker()
          Creates a spell checker for this query handler.
protected  SynonymProvider createSynonymProvider()
           
protected  FileSystemResource createSynonymProviderConfigResource()
          Creates a file system resource to the synonym provider configuration.
protected  TextExtractor createTextExtractor()
          Factory method to create the TextExtractor instance.
 void deleteNode(NodeId id)
          Removes the node with uuid from the search index.
protected  void doInit()
          Initializes this QueryHandler.
 MultiColumnQueryHits executeQuery(SessionImpl session, AbstractQueryImpl queryImpl, org.apache.lucene.search.Query query, Name[] orderProps, boolean[] orderSpecs)
          Executes the query on the search index.
 String getAnalyzer()
          Returns the class name of the analyzer that is currently in use.
 boolean getAutoRepair()
           
 int getBufferSize()
          Returns the current value for the buffer size.
 int getCacheSize()
           
 boolean getEnableConsistencyCheck()
           
 String getExcerptProviderClass()
           
 int getExtractorBackLogSize()
           
 int getExtractorPoolSize()
           
 long getExtractorTimeout()
           
 boolean getForceConsistencyCheck()
           
protected  MultiIndex getIndex()
          Returns the actual index.
 IndexFormatVersion getIndexFormatVersion()
          Returns the index format version that this search index is able to support when a query is executed on this index.
 IndexingConfiguration getIndexingConfig()
           
 String getIndexingConfiguration()
           
 String getIndexingConfigurationClass()
           
protected  Element getIndexingConfigurationDOM()
          Returns the document element of the indexing configuration or null if there is no indexing configuration.
 org.apache.lucene.index.IndexReader getIndexReader()
          Returns an index reader for this search index.
protected  org.apache.lucene.index.IndexReader getIndexReader(boolean includeSystemIndex)
          Returns an index reader for this search index.
 int getMaxFieldLength()
           
 int getMaxMergeDocs()
          Returns the current value for maxMergeDocs.
 int getMergeFactor()
          Returns the current value for the merge factor.
 int getMinMergeDocs()
          Returns the current value for minMergeDocs.
 NamespaceMappings getNamespaceMappings()
          Returns the namespace mappings for the internal representation.
 String getPath()
          Returns the location of the search index.
protected  DefaultQueryNodeFactory getQueryNodeFactory()
          This method returns the QueryNodeFactory used to parse Queries.
 boolean getRespectDocumentOrder()
           
 int getResultFetchSize()
           
 org.apache.lucene.search.Similarity getSimilarity()
           
 String getSimilarityClass()
           
 SpellChecker getSpellChecker()
           
 String getSpellCheckerClass()
           
 boolean getSupportHighlighting()
           
 SynonymProvider getSynonymProvider()
           
 String getSynonymProviderClass()
           
 String getSynonymProviderConfigPath()
           
 org.apache.lucene.analysis.Analyzer getTextAnalyzer()
          Returns the analyzer in use for indexing.
 TextExtractor getTextExtractor()
          Returns the text extractor in use for indexing.
 String getTextFilterClasses()
          Returns the fully qualified class names of the text filter instances currently in use.
 boolean getUseCompoundFile()
          Returns the current value for useCompoundFile.
 int getVolatileIdleTime()
          Returns the current value for volatileIdleTime.
protected  void mergeAggregatedNodeIndexes(NodeState state, org.apache.lucene.document.Document doc)
          Merges the fulltext indexed fields of the aggregated node states into doc.
protected  void retrieveAggregateRoot(NodeState state, Map map)
          Retrieves the root of the indexing aggregate for state and puts it into map.
protected  void retrieveAggregateRoot(Set removedNodeIds, Map map)
          Retrieves the root of the indexing aggregate for removedNodeIds and puts it into map.
 void setAnalyzer(String analyzerClassName)
          Sets the analyzer in use for indexing.
 void setAutoRepair(boolean b)
           
 void setBufferSize(int size)
           
 void setCacheSize(int size)
           
 void setEnableConsistencyCheck(boolean b)
          Enables or disables the consistency check on startup.
 void setExcerptProviderClass(String className)
          Sets the class name for the ExcerptProvider that should be used for the rep:excerpt pseudo property in a query.
 void setExtractorBackLogSize(int backLog)
          The number of extractor jobs that are queued until a new job is executed with the current thread instead of using the thread pool.
 void setExtractorPoolSize(int numThreads)
          The number of background threads for the extractor pool.
 void setExtractorTimeout(long timeout)
          The timeout in milliseconds which is granted to the text extraction process until fulltext indexing is deferred to a background thread.
 void setForceConsistencyCheck(boolean b)
           
 void setIndexingConfiguration(String path)
          Sets the path to the indexing configuration file.
 void setIndexingConfigurationClass(String className)
          Sets the name of the class that implements IndexingConfiguration.
 void setMaxFieldLength(int length)
           
 void setMaxMergeDocs(int maxMergeDocs)
          The lucene index writer property: maxMergeDocs
 void setMergeFactor(int mergeFactor)
          The lucene index writer property: mergeFactor
 void setMinMergeDocs(int minMergeDocs)
          The lucene index writer property: minMergeDocs
 void setPath(String path)
          Sets the location of the search index.
 void setRespectDocumentOrder(boolean docOrder)
           
 void setResultFetchSize(int size)
          Tells the query handler how many result should be fetched initially when a query is executed.
 void setSimilarityClass(String className)
          Sets the similarity implementation, which will be used for indexing and searching.
 void setSpellCheckerClass(String className)
          Sets the name of the class that implements SpellChecker.
 void setSupportHighlighting(boolean b)
          If set to true additional information is stored in the index to support highlighting using the rep:excerpt pseudo property.
 void setSynonymProviderClass(String className)
          Sets the name of the class that implements SynonymProvider.
 void setSynonymProviderConfigPath(String path)
          Sets the configuration path for the synonym provider.
 void setTextFilterClasses(String filterClasses)
          Sets the list of text extractors (and text filters) to use for extracting text content from binary properties.
 void setUseCompoundFile(boolean b)
          The lucene index writer property: useCompoundFile
 void setVolatileIdleTime(int volatileIdleTime)
          Sets the property: volatileIdleTime
 void updateNodes(NodeIdIterator remove, NodeStateIterator add)
          This implementation forwards the call to MultiIndex.update(java.util.Iterator, java.util.Iterator) and transforms the two iterators to the required types.
 
Methods inherited from class org.apache.jackrabbit.core.query.AbstractQueryHandler
getContext, getIdleTime, getOnWorkspaceInconsistency, getOnWorkspaceInconsistencyHandler, getQueryClass, init, setIdleTime, setOnWorkspaceInconsistency, setQueryClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALID_SYSTEM_INDEX_NODE_TYPE_NAMES

public static final List VALID_SYSTEM_INDEX_NODE_TYPE_NAMES

DEFAULT_MIN_MERGE_DOCS

public static final int DEFAULT_MIN_MERGE_DOCS
The default value for property minMergeDocs.

See Also:
Constant Field Values

DEFAULT_MAX_MERGE_DOCS

public static final int DEFAULT_MAX_MERGE_DOCS
The default value for property maxMergeDocs.

See Also:
Constant Field Values

DEFAULT_MERGE_FACTOR

public static final int DEFAULT_MERGE_FACTOR
the default value for property mergeFactor.

See Also:
Constant Field Values

DEFAULT_MAX_FIELD_LENGTH

public static final int DEFAULT_MAX_FIELD_LENGTH
the default value for property maxFieldLength.

See Also:
Constant Field Values

DEFAULT_EXTRACTOR_POOL_SIZE

public static final int DEFAULT_EXTRACTOR_POOL_SIZE
Deprecated. this value is not used anymore. Instead the default value is calculated as follows: 2 * Runtime.getRuntime().availableProcessors().
The default value for property extractorPoolSize.

See Also:
Constant Field Values

DEFAULT_EXTRACTOR_BACK_LOG

public static final int DEFAULT_EXTRACTOR_BACK_LOG
The default value for property extractorBackLog.

See Also:
Constant Field Values

DEFAULT_EXTRACTOR_TIMEOUT

public static final long DEFAULT_EXTRACTOR_TIMEOUT
The default timeout in milliseconds which is granted to the text extraction process until fulltext indexing is deferred to a background thread.

See Also:
Constant Field Values
Constructor Detail

SearchIndex

public SearchIndex()
Default constructor.

Method Detail

doInit

protected void doInit()
               throws IOException
Initializes this QueryHandler. This implementation requires that a path parameter is set in the configuration. If this condition is not met, a IOException is thrown.

Specified by:
doInit in class AbstractQueryHandler
Throws:
IOException - if an error occurs while initializing this handler.

addNode

public void addNode(NodeState node)
             throws RepositoryException,
                    IOException
Adds the node to the search index.

Parameters:
node - the node to add.
Throws:
RepositoryException - if an error occurs while indexing the node.
IOException - if an error occurs while adding the node to the index.

deleteNode

public void deleteNode(NodeId id)
                throws IOException
Removes the node with uuid from the search index.

Parameters:
id - the id of the node to remove from the index.
Throws:
IOException - if an error occurs while removing the node from the index.

updateNodes

public void updateNodes(NodeIdIterator remove,
                        NodeStateIterator add)
                 throws RepositoryException,
                        IOException
This implementation forwards the call to MultiIndex.update(java.util.Iterator, java.util.Iterator) and transforms the two iterators to the required types.

Specified by:
updateNodes in interface QueryHandler
Overrides:
updateNodes in class AbstractQueryHandler
Parameters:
remove - uuids of nodes to remove.
add - NodeStates to add. Calls to next() on this iterator may return null, to indicate that a node could not be indexed successfully.
Throws:
RepositoryException - if an error occurs while indexing a node.
IOException - if an error occurs while updating the index.

createExecutableQuery

public ExecutableQuery createExecutableQuery(SessionImpl session,
                                             ItemManager itemMgr,
                                             String statement,
                                             String language)
                                      throws InvalidQueryException
Creates a new query by specifying the query statement itself and the language in which the query is stated. If the query statement is syntactically invalid, given the language specified, an InvalidQueryException is thrown. language must specify a query language string from among those returned by QueryManager.getSupportedQueryLanguages(); if it is not then an InvalidQueryException is thrown.

Parameters:
session - the session of the current user creating the query object.
itemMgr - the item manager of the current user.
statement - the query statement.
language - the syntax of the query statement.
Returns:
A Query object.
Throws:
InvalidQueryException - if statement is invalid or language is unsupported.

createExecutableQuery

public ExecutableQuery createExecutableQuery(SessionImpl session,
                                             ItemManager itemMgr,
                                             QueryObjectModelTree qomTree)
                                      throws InvalidQueryException
Creates a new query by specifying the query object model. If the query object model is considered invalid for the implementing class, an InvalidQueryException is thrown.

Parameters:
session - the session of the current user creating the query object.
itemMgr - the item manager of the current user.
qomTree - query query object model tree.
Returns:
A Query object.
Throws:
InvalidQueryException - if the query object model tree is invalid.
See Also:
QueryHandler.createExecutableQuery(SessionImpl, ItemManager, QueryObjectModelTree)

getQueryNodeFactory

protected DefaultQueryNodeFactory getQueryNodeFactory()
This method returns the QueryNodeFactory used to parse Queries. This method may be overridden to provide a customized QueryNodeFactory


close

public void close()
Closes this QueryHandler and frees resources attached to this handler.


executeQuery

public MultiColumnQueryHits executeQuery(SessionImpl session,
                                         AbstractQueryImpl queryImpl,
                                         org.apache.lucene.search.Query query,
                                         Name[] orderProps,
                                         boolean[] orderSpecs)
                                  throws IOException
Executes the query on the search index.

Parameters:
session - the session that executes the query.
queryImpl - the query impl.
query - the lucene query.
orderProps - name of the properties for sort order.
orderSpecs - the order specs for the sort order properties. true indicates ascending order, false indicates descending.
Returns:
the query hits.
Throws:
IOException - if an error occurs while searching the index.

createExcerptProvider

public ExcerptProvider createExcerptProvider(org.apache.lucene.search.Query query)
                                      throws IOException
Creates an excerpt provider for the given query.

Parameters:
query - the query.
Returns:
an excerpt provider for the given query.
Throws:
IOException - if the provider cannot be created.

getTextAnalyzer

public org.apache.lucene.analysis.Analyzer getTextAnalyzer()
Returns the analyzer in use for indexing.

Returns:
the analyzer in use for indexing.

getTextExtractor

public TextExtractor getTextExtractor()
Returns the text extractor in use for indexing.

Returns:
the text extractor in use for indexing.

getNamespaceMappings

public NamespaceMappings getNamespaceMappings()
Returns the namespace mappings for the internal representation.

Returns:
the namespace mappings for the internal representation.

getIndexingConfig

public IndexingConfiguration getIndexingConfig()
Returns:
the indexing configuration or null if there is none.

getSynonymProvider

public SynonymProvider getSynonymProvider()
Returns:
the synonym provider of this search index. If none is set for this search index the synonym provider of the parent handler is returned if there is any.

getSpellChecker

public SpellChecker getSpellChecker()
Returns:
the spell checker of this search index. If none is configured this method returns null.

getSimilarity

public org.apache.lucene.search.Similarity getSimilarity()
Returns:
the similarity, which should be used for indexing and searching.

getIndexReader

public org.apache.lucene.index.IndexReader getIndexReader()
                                                   throws IOException
Returns an index reader for this search index. The caller of this method is responsible for closing the index reader when he is finished using it.

Returns:
an index reader for this search index.
Throws:
IOException - the index reader cannot be obtained.

getIndexFormatVersion

public IndexFormatVersion getIndexFormatVersion()
Returns the index format version that this search index is able to support when a query is executed on this index.

Returns:
the index format version for this search index.

getIndexReader

protected org.apache.lucene.index.IndexReader getIndexReader(boolean includeSystemIndex)
                                                      throws IOException
Returns an index reader for this search index. The caller of this method is responsible for closing the index reader when he is finished using it.

Parameters:
includeSystemIndex - if true the index reader will cover the complete workspace. If false the returned index reader will not contains any nodes under /jcr:system.
Returns:
an index reader for this search index.
Throws:
IOException - the index reader cannot be obtained.

createSortFields

protected org.apache.lucene.search.SortField[] createSortFields(Name[] orderProps,
                                                                boolean[] orderSpecs)
Creates the SortFields for the order properties.

Parameters:
orderProps - the order properties.
orderSpecs - the order specs for the properties.
Returns:
an array of sort fields

createDocument

protected org.apache.lucene.document.Document createDocument(NodeState node,
                                                             NamespaceMappings nsMappings,
                                                             IndexFormatVersion indexFormatVersion)
                                                      throws RepositoryException
Creates a lucene Document for a node state using the namespace mappings nsMappings.

Parameters:
node - the node state to index.
nsMappings - the namespace mappings of the search index.
indexFormatVersion - the index format version that should be used to index the passed node state.
Returns:
a lucene Document that contains all properties of node.
Throws:
RepositoryException - if an error occurs while indexing the node.

getIndex

protected MultiIndex getIndex()
Returns the actual index.

Returns:
the actual index.

createTextExtractor

protected TextExtractor createTextExtractor()
Factory method to create the TextExtractor instance.

Returns:
the TextExtractor instance this index should use.

createIndexingConfiguration

protected IndexingConfiguration createIndexingConfiguration(NamespaceMappings namespaceMappings)
Parameters:
namespaceMappings - The namespace mappings
Returns:
the fulltext indexing configuration or null if there is no configuration.

createSynonymProvider

protected SynonymProvider createSynonymProvider()
Returns:
the configured synonym provider or null if none is configured or an error occurs.

createSynonymProviderConfigResource

protected FileSystemResource createSynonymProviderConfigResource()
                                                          throws FileSystemException,
                                                                 IOException
Creates a file system resource to the synonym provider configuration.

Returns:
a file system resource or null if no path was configured.
Throws:
FileSystemException - if an exception occurs accessing the file system.
IOException

createSpellChecker

protected SpellChecker createSpellChecker()
Creates a spell checker for this query handler.

Returns:
the spell checker or null if none is configured or an error occurs.

getIndexingConfigurationDOM

protected Element getIndexingConfigurationDOM()
Returns the document element of the indexing configuration or null if there is no indexing configuration.

Returns:
the indexing configuration or null if there is none.

mergeAggregatedNodeIndexes

protected void mergeAggregatedNodeIndexes(NodeState state,
                                          org.apache.lucene.document.Document doc)
Merges the fulltext indexed fields of the aggregated node states into doc.

Parameters:
state - the node state on which doc was created.
doc - the lucene document with index fields from state.

retrieveAggregateRoot

protected void retrieveAggregateRoot(NodeState state,
                                     Map map)
Retrieves the root of the indexing aggregate for state and puts it into map.

Parameters:
state - the node state for which we want to retrieve the aggregate root.
map - aggregate roots are collected in this map. Key=NodeId, value=NodeState.

retrieveAggregateRoot

protected void retrieveAggregateRoot(Set removedNodeIds,
                                     Map map)
Retrieves the root of the indexing aggregate for removedNodeIds and puts it into map.

Parameters:
removedNodeIds - the ids of removed nodes.
map - aggregate roots are collected in this map. Key=NodeId, value=NodeState.

setAnalyzer

public void setAnalyzer(String analyzerClassName)
Sets the analyzer in use for indexing. The given analyzer class name must satisfy the following conditions:

If the above conditions are met, then a new instance of the class is set as the analyzer. Otherwise a warning is logged and the current analyzer is not changed.

This property setter method is normally invoked by the Jackrabbit configuration mechanism if the "analyzer" parameter is set in the search configuration.

Parameters:
analyzerClassName - the analyzer class name

getAnalyzer

public String getAnalyzer()
Returns the class name of the analyzer that is currently in use.

Returns:
class name of analyzer in use.

setPath

public void setPath(String path)
Sets the location of the search index.

Parameters:
path - the location of the search index.

getPath

public String getPath()
Returns the location of the search index. Returns null if not set.

Returns:
the location of the search index.

setUseCompoundFile

public void setUseCompoundFile(boolean b)
The lucene index writer property: useCompoundFile


getUseCompoundFile

public boolean getUseCompoundFile()
Returns the current value for useCompoundFile.

Returns:
the current value for useCompoundFile.

setMinMergeDocs

public void setMinMergeDocs(int minMergeDocs)
The lucene index writer property: minMergeDocs


getMinMergeDocs

public int getMinMergeDocs()
Returns the current value for minMergeDocs.

Returns:
the current value for minMergeDocs.

setVolatileIdleTime

public void setVolatileIdleTime(int volatileIdleTime)
Sets the property: volatileIdleTime

Parameters:
volatileIdleTime - idle time in seconds

getVolatileIdleTime

public int getVolatileIdleTime()
Returns the current value for volatileIdleTime.

Returns:
the current value for volatileIdleTime.

setMaxMergeDocs

public void setMaxMergeDocs(int maxMergeDocs)
The lucene index writer property: maxMergeDocs


getMaxMergeDocs

public int getMaxMergeDocs()
Returns the current value for maxMergeDocs.

Returns:
the current value for maxMergeDocs.

setMergeFactor

public void setMergeFactor(int mergeFactor)
The lucene index writer property: mergeFactor


getMergeFactor

public int getMergeFactor()
Returns the current value for the merge factor.

Returns:
the current value for the merge factor.

setBufferSize

public void setBufferSize(int size)
See Also:
VolatileIndex.setBufferSize(int)

getBufferSize

public int getBufferSize()
Returns the current value for the buffer size.

Returns:
the current value for the buffer size.

setRespectDocumentOrder

public void setRespectDocumentOrder(boolean docOrder)

getRespectDocumentOrder

public boolean getRespectDocumentOrder()

setForceConsistencyCheck

public void setForceConsistencyCheck(boolean b)

getForceConsistencyCheck

public boolean getForceConsistencyCheck()

setAutoRepair

public void setAutoRepair(boolean b)

getAutoRepair

public boolean getAutoRepair()

setCacheSize

public void setCacheSize(int size)

getCacheSize

public int getCacheSize()

setMaxFieldLength

public void setMaxFieldLength(int length)

getMaxFieldLength

public int getMaxFieldLength()

setTextFilterClasses

public void setTextFilterClasses(String filterClasses)
Sets the list of text extractors (and text filters) to use for extracting text content from binary properties. The list must be comma (or whitespace) separated, and contain fully qualified class names of the TextExtractor (and TextFilter) classes to be used. The configured classes must all have a public default constructor.

Parameters:
filterClasses - comma separated list of class names

getTextFilterClasses

public String getTextFilterClasses()
Returns the fully qualified class names of the text filter instances currently in use. The names are comma separated.

Returns:
class names of the text filters in use.

setResultFetchSize

public void setResultFetchSize(int size)
Tells the query handler how many result should be fetched initially when a query is executed.

Parameters:
size - the number of results to fetch initially.

getResultFetchSize

public int getResultFetchSize()
Returns:
the number of results the query handler will fetch initially when a query is executed.

setExtractorPoolSize

public void setExtractorPoolSize(int numThreads)
The number of background threads for the extractor pool.

Parameters:
numThreads - the number of threads.

getExtractorPoolSize

public int getExtractorPoolSize()
Returns:
the size of the thread pool which is used to run the text extractors when binary content is indexed.

setExtractorBackLogSize

public void setExtractorBackLogSize(int backLog)
The number of extractor jobs that are queued until a new job is executed with the current thread instead of using the thread pool.

Parameters:
backLog - size of the extractor job queue.

getExtractorBackLogSize

public int getExtractorBackLogSize()
Returns:
the size of the extractor queue back log.

setExtractorTimeout

public void setExtractorTimeout(long timeout)
The timeout in milliseconds which is granted to the text extraction process until fulltext indexing is deferred to a background thread.

Parameters:
timeout - the timeout in milliseconds.

getExtractorTimeout

public long getExtractorTimeout()
Returns:
the extractor timeout in milliseconds.

setSupportHighlighting

public void setSupportHighlighting(boolean b)
If set to true additional information is stored in the index to support highlighting using the rep:excerpt pseudo property.

Parameters:
b - true to enable highlighting support.

getSupportHighlighting

public boolean getSupportHighlighting()
Returns:
true if highlighting support is enabled.

setExcerptProviderClass

public void setExcerptProviderClass(String className)
Sets the class name for the ExcerptProvider that should be used for the rep:excerpt pseudo property in a query.

Parameters:
className - the name of a class that implements ExcerptProvider.

getExcerptProviderClass

public String getExcerptProviderClass()
Returns:
the class name of the excerpt provider implementation.

setIndexingConfiguration

public void setIndexingConfiguration(String path)
Sets the path to the indexing configuration file.

Parameters:
path - the path to the configuration file.

getIndexingConfiguration

public String getIndexingConfiguration()
Returns:
the path to the indexing configuration file.

setIndexingConfigurationClass

public void setIndexingConfigurationClass(String className)
Sets the name of the class that implements IndexingConfiguration. The default value is org.apache.jackrabbit.core.query.lucene.IndexingConfigurationImpl.

Parameters:
className - the name of the class that implements IndexingConfiguration.

getIndexingConfigurationClass

public String getIndexingConfigurationClass()
Returns:
the class name of the indexing configuration implementation.

setSynonymProviderClass

public void setSynonymProviderClass(String className)
Sets the name of the class that implements SynonymProvider. The default value is null (none set).

Parameters:
className - name of the class that implements SynonymProvider.

getSynonymProviderClass

public String getSynonymProviderClass()
Returns:
the class name of the synonym provider implementation or null if none is set.

setSpellCheckerClass

public void setSpellCheckerClass(String className)
Sets the name of the class that implements SpellChecker. The default value is null (none set).

Parameters:
className - name of the class that implements SpellChecker.

getSpellCheckerClass

public String getSpellCheckerClass()
Returns:
the class name of the spell checker implementation or null if none is set.

setEnableConsistencyCheck

public void setEnableConsistencyCheck(boolean b)
Enables or disables the consistency check on startup. Consistency checks are disabled per default.

Parameters:
b - true enables consistency checks.
See Also:
setForceConsistencyCheck(boolean)

getEnableConsistencyCheck

public boolean getEnableConsistencyCheck()
Returns:
true if consistency checks are enabled.

setSynonymProviderConfigPath

public void setSynonymProviderConfigPath(String path)
Sets the configuration path for the synonym provider.

Parameters:
path - the configuration path for the synonym provider.

getSynonymProviderConfigPath

public String getSynonymProviderConfigPath()
Returns:
the configuration path for the synonym provider. If none is set this method returns null.

setSimilarityClass

public void setSimilarityClass(String className)
Sets the similarity implementation, which will be used for indexing and searching. The implementation must extend Similarity.

Parameters:
className - a Similarity implementation.

getSimilarityClass

public String getSimilarityClass()
Returns:
the name of the similarity class.


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