org.compass.core.engine
Interface SearchEngineOptimizer

All Known Implementing Classes:
LuceneSearchEngineOptimizerManager

public interface SearchEngineOptimizer

Optimizes search engine index data. Can control a scheduled optimizer that will run periodically using start() and stop().

Author:
kimchy

Method Summary
 boolean isRunning()
          Returns true if the optimizer is running a scheduled optimizer.
 void optimize()
          Optimizes the search engine index if it requires optimization.
 void optimize(int maxNumberOfSegments)
          Optimizes all the sub indexes down to the required maximum number of segments.
 void optimize(String subIndex)
          Optimizes the sub index does to a configured max number of segments.
 void optimize(String subIndex, int maxNumberOfSegments)
          Optimizes a specific sub index down to a required maximum number of segments.
 void start()
          Starts the given optimizer.
 void stop()
          Stops the given optimizer.
 

Method Detail

start

void start()
           throws SearchEngineException
Starts the given optimizer. Will start a scheduled optimizer if configured. If not, does nothing.

Throws:
SearchEngineException

stop

void stop()
          throws SearchEngineException
Stops the given optimizer. Will stop the scheduled optimizer if configured. If not, does nothing.

Note that if the optimizer is stopped while optimizing, it might take some time till the optimizer will actually stop.

Throws:
SearchEngineException

isRunning

boolean isRunning()
Returns true if the optimizer is running a scheduled optimizer.


optimize

void optimize()
              throws SearchEngineException
Optimizes the search engine index if it requires optimization. The optimization will be perfomed on all sub indexes and based on configuration. For example, the default optimizer will use the configured maxNumberOfSegments in order to perform the optimization.

Throws:
SearchEngineException

optimize

void optimize(int maxNumberOfSegments)
              throws SearchEngineException
Optimizes all the sub indexes down to the required maximum number of segments.

Throws:
SearchEngineException

optimize

void optimize(String subIndex)
              throws SearchEngineException
Optimizes the sub index does to a configured max number of segments.

Throws:
SearchEngineException

optimize

void optimize(String subIndex,
              int maxNumberOfSegments)
              throws SearchEngineException
Optimizes a specific sub index down to a required maximum number of segments.

Throws:
SearchEngineException


Copyright (c) 2004-2009 The Compass Project.