org.compass.core.lucene.engine.optimizer
Class DefaultLuceneSearchEngineOptimizer

java.lang.Object
  extended by org.compass.core.lucene.engine.optimizer.DefaultLuceneSearchEngineOptimizer
All Implemented Interfaces:
CompassConfigurable, SearchEngineFactoryAware, LuceneSearchEngineOptimizer

public class DefaultLuceneSearchEngineOptimizer
extends Object
implements LuceneSearchEngineOptimizer, CompassConfigurable, SearchEngineFactoryAware

Author:
kimchy

Constructor Summary
DefaultLuceneSearchEngineOptimizer()
           
 
Method Summary
 boolean canBeScheduled()
          Can the optimizer be scheduled or not.
 void configure(CompassSettings settings)
          Configure using the given settings.
protected  LuceneSubIndexInfo doGetIndexInfo(String subIndex)
           
protected  void doOptimize(String subIndex, int maxNumberOfSegments)
           
 void optimize()
          Optimizes the search engine index if it requires optimization.
 void optimize(int maxNumberOfSegments)
          Forces an optimization to occur and maintain to the number of "mergeFactor" segments.
 void optimize(String subIndex)
          Optimizes the sub index if it requires optimization.
 void optimize(String subIndex, int maxNumberOfSegments)
          Forces an optimization to occur for the specific sub index and maintain to the number of "mergeFactor" segments.
 void setSearchEngineFactory(SearchEngineFactory searchEngineFactory)
          Injects the search engine factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLuceneSearchEngineOptimizer

public DefaultLuceneSearchEngineOptimizer()
Method Detail

setSearchEngineFactory

public void setSearchEngineFactory(SearchEngineFactory searchEngineFactory)
Description copied from interface: SearchEngineFactoryAware
Injects the search engine factory.

Specified by:
setSearchEngineFactory in interface SearchEngineFactoryAware

configure

public void configure(CompassSettings settings)
               throws CompassException
Description copied from interface: CompassConfigurable
Configure using the given settings.

Specified by:
configure in interface CompassConfigurable
Parameters:
settings - The settings for the configured object
Throws:
CompassException

canBeScheduled

public boolean canBeScheduled()
Description copied from interface: LuceneSearchEngineOptimizer
Can the optimizer be scheduled or not.

Specified by:
canBeScheduled in interface LuceneSearchEngineOptimizer

optimize

public void optimize()
              throws SearchEngineException
Description copied from interface: LuceneSearchEngineOptimizer
Optimizes the search engine index if it requires optimization.

Specified by:
optimize in interface LuceneSearchEngineOptimizer
Throws:
SearchEngineException

optimize

public void optimize(int maxNumberOfSegments)
Description copied from interface: LuceneSearchEngineOptimizer
Forces an optimization to occur and maintain to the number of "mergeFactor" segments.

Specified by:
optimize in interface LuceneSearchEngineOptimizer

optimize

public void optimize(String subIndex)
              throws SearchEngineException
Description copied from interface: LuceneSearchEngineOptimizer
Optimizes the sub index if it requires optimization.

Specified by:
optimize in interface LuceneSearchEngineOptimizer
Parameters:
subIndex - The sub index to optimize
Throws:
SearchEngineException

optimize

public void optimize(String subIndex,
                     int maxNumberOfSegments)
Description copied from interface: LuceneSearchEngineOptimizer
Forces an optimization to occur for the specific sub index and maintain to the number of "mergeFactor" segments.

Specified by:
optimize in interface LuceneSearchEngineOptimizer

doOptimize

protected void doOptimize(String subIndex,
                          int maxNumberOfSegments)
                   throws SearchEngineException
Throws:
SearchEngineException

doGetIndexInfo

protected LuceneSubIndexInfo doGetIndexInfo(String subIndex)
                                     throws SearchEngineException
Throws:
SearchEngineException


Copyright (c) 2004-2009 The Compass Project.