org.compass.core.engine.spellcheck
Interface SearchEngineSpellCheckManager

All Known Subinterfaces:
InternalLuceneSearchEngineSpellCheckManager, InternalSearchEngineSpellCheckManager
All Known Implementing Classes:
DefaultLuceneSpellCheckManager

public interface SearchEngineSpellCheckManager

The spell check manager allows to perform spell check index level operations. It also allows to perform operations using the spell check, for example to suggest words for a given word.

The spell check manager can be configured using LuceneEnvironment.SpellCheck settings.

Author:
kimchy

Method Summary
 boolean concurrentRebuild()
          Same as rebuild() but executes the rebuild of each sub index using Compass built in thread pool
 void concurrentRefresh()
          Same as refresh() but executes the refresh of each sub index using Compass built in thread pool.
 void deleteIndex()
          Deletes the spell check index.
 void deleteIndex(String subIndex)
          Deletes the spell check index for the given sub index.
 boolean isRebuildNeeded()
          Returns true if a rebuild of the spell check index is required.
 boolean isRebuildNeeded(String subIndex)
          Returns true if a rebuild of the spell index for the given sub index is required.
 boolean rebuild()
          Rebuilds the spell check index.
 boolean rebuild(String subIndex)
          Rebuilds the spell check index for the given sub index.
 void refresh()
          Refresh the internal readers and searches that work with the spell index.
 void refresh(String subIndex)
          Refresh the internal readers and searches for the given sub index that work with the spell index.
 void start()
          Starts the spell check manager.
 void stop()
          Stops any scheduled tasks started by the start() method.
 CompassQuery suggest(CompassQuery query)
          Suggests a query based on the given query.
 SearchEngineSpellCheckSuggestBuilder suggestBuilder(String word)
          Creates a suggest builder allowing to suggest words for the given word.
 

Method Detail

start

void start()
Starts the spell check manager. Will start a scheduled task to refresh the cached searchers and readers over the spell check index. Will also schedule, if configured, a schediled rebuild of the spell check index.


stop

void stop()
Stops any scheduled tasks started by the start() method.


isRebuildNeeded

boolean isRebuildNeeded()
                        throws SearchEngineException
Returns true if a rebuild of the spell check index is required.

Throws:
SearchEngineException

isRebuildNeeded

boolean isRebuildNeeded(String subIndex)
                        throws SearchEngineException
Returns true if a rebuild of the spell index for the given sub index is required.

Throws:
SearchEngineException

concurrentRebuild

boolean concurrentRebuild()
                          throws SearchEngineException
Same as rebuild() but executes the rebuild of each sub index using Compass built in thread pool

Throws:
SearchEngineException

rebuild

boolean rebuild()
                throws SearchEngineException
Rebuilds the spell check index. Won't rebuild specific sub indexes if it is not needed.

Throws:
SearchEngineException

rebuild

boolean rebuild(String subIndex)
                throws SearchEngineException
Rebuilds the spell check index for the given sub index. Won't rebuild if it is not needed.

Throws:
SearchEngineException

concurrentRefresh

void concurrentRefresh()
                       throws SearchEngineException
Same as refresh() but executes the refresh of each sub index using Compass built in thread pool.

Throws:
SearchEngineException

refresh

void refresh()
             throws SearchEngineException
Refresh the internal readers and searches that work with the spell index.

Throws:
SearchEngineException

refresh

void refresh(String subIndex)
             throws SearchEngineException
Refresh the internal readers and searches for the given sub index that work with the spell index.

Throws:
SearchEngineException

deleteIndex

void deleteIndex()
                 throws SearchEngineException
Deletes the spell check index.

Throws:
SearchEngineException

deleteIndex

void deleteIndex(String subIndex)
                 throws SearchEngineException
Deletes the spell check index for the given sub index.

Throws:
SearchEngineException

suggestBuilder

SearchEngineSpellCheckSuggestBuilder suggestBuilder(String word)
Creates a suggest builder allowing to suggest words for the given word.


suggest

CompassQuery suggest(CompassQuery query)
Suggests a query based on the given query. Note, if the query was replaced/sugested then the CompassQuery.isSuggested() flag will be set to true.



Copyright (c) 2004-2009 The Compass Project.