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

java.lang.Object
  extended by org.compass.core.lucene.engine.optimizer.AbstractOptimizer
      extended by org.compass.core.lucene.engine.optimizer.AbstractIndexInfoOptimizer
          extended by org.compass.core.lucene.engine.optimizer.AggressiveOptimizer
All Implemented Interfaces:
CompassConfigurable, SearchEngineOptimizer, LuceneSearchEngineOptimizer

public class AggressiveOptimizer
extends AbstractIndexInfoOptimizer
implements CompassConfigurable

Agressive optimzer optimizes the index down to a single segment once it has more that the configured merge factor segments. The merge factor can be configured using LuceneEnvironment.Optimizer.Aggressive.MERGE_FACTOR (which deftauls to 10).

Forced optimization will optimize the index regardless of the number of segments.

Author:
kimchy

Field Summary
 
Fields inherited from class org.compass.core.lucene.engine.optimizer.AbstractOptimizer
log
 
Constructor Summary
AggressiveOptimizer()
           
 
Method Summary
 boolean canBeScheduled()
          Can the optimizer be scheduled or not.
 void configure(CompassSettings settings)
          Configure using the given settings.
protected  void doForceOptimize(String subIndex, LuceneSubIndexInfo indexInfo)
           
protected  boolean doNeedOptimizing(String subIndex, LuceneSubIndexInfo indexInfo)
           
protected  void doOptimize(String subIndex, LuceneSubIndexInfo indexInfo)
           
protected  boolean isOptimizeOnlyIfIndexChanged()
           
 
Methods inherited from class org.compass.core.lucene.engine.optimizer.AbstractIndexInfoOptimizer
doForceOptimize, doGetIndexInfo, doOptimize
 
Methods inherited from class org.compass.core.lucene.engine.optimizer.AbstractOptimizer
doStart, doStop, forceOptimize, forceOptimize, getSearchEngineFactory, isRunning, optimize, optimize, setSearchEngineFactory, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggressiveOptimizer

public AggressiveOptimizer()
Method Detail

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

isOptimizeOnlyIfIndexChanged

protected boolean isOptimizeOnlyIfIndexChanged()

doNeedOptimizing

protected boolean doNeedOptimizing(String subIndex,
                                   LuceneSubIndexInfo indexInfo)

doOptimize

protected void doOptimize(String subIndex,
                          LuceneSubIndexInfo indexInfo)
                   throws SearchEngineException
Specified by:
doOptimize in class AbstractIndexInfoOptimizer
Throws:
SearchEngineException

doForceOptimize

protected void doForceOptimize(String subIndex,
                               LuceneSubIndexInfo indexInfo)
                        throws SearchEngineException
Specified by:
doForceOptimize in class AbstractIndexInfoOptimizer
Throws:
SearchEngineException


Copyright (c) 2004-2008 The Compass Project.