org.compass.core.lucene.engine.analyzer
Class LuceneAnalyzerManager

java.lang.Object
  extended by org.compass.core.lucene.engine.analyzer.LuceneAnalyzerManager

public class LuceneAnalyzerManager
extends Object

Manages all the configured Lucene analyzers within Compass.

Author:
kimchy

Constructor Summary
LuceneAnalyzerManager(CompassSettings settings, CompassMapping mapping)
           
 
Method Summary
 void close()
           
 Analyzer getAnalyzer(String analyzerName)
          Returns the Lucene Analyzer registed under the given name.
 Analyzer getAnalyzerByAlias(String alias)
          Returns the Lucene Analyzer for the given alias.
 Analyzer getAnalyzerByAliasMustExists(String alias)
           
 Analyzer getAnalyzerByResource(Resource resource)
          Returns the Lucene Analyzer based on the give Resource.
 Analyzer getAnalyzerMustExist(String analyzerName)
           
 Analyzer getDefaultAnalyzer()
          Returns the default Lucene Analyzer for Compass.
 Analyzer getSearchAnalyzer()
          Returns the search Lucene Analyzer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneAnalyzerManager

public LuceneAnalyzerManager(CompassSettings settings,
                             CompassMapping mapping)
                      throws SearchEngineException
Throws:
SearchEngineException
Method Detail

close

public void close()

getDefaultAnalyzer

public Analyzer getDefaultAnalyzer()
Returns the default Lucene Analyzer for Compass.


getSearchAnalyzer

public Analyzer getSearchAnalyzer()
Returns the search Lucene Analyzer.


getAnalyzer

public Analyzer getAnalyzer(String analyzerName)
Returns the Lucene Analyzer registed under the given name.


getAnalyzerByAlias

public Analyzer getAnalyzerByAlias(String alias)
Returns the Lucene Analyzer for the given alias. Might build a per field analyzer if the resource has more than one analyzer against one of its properties.


getAnalyzerByAliasMustExists

public Analyzer getAnalyzerByAliasMustExists(String alias)
                                      throws SearchEngineException
Throws:
SearchEngineException

getAnalyzerByResource

public Analyzer getAnalyzerByResource(Resource resource)
                               throws SearchEngineException
Returns the Lucene Analyzer based on the give Resource. Will build a specifc per field analyzr if the given Resource has properties with different analyzers. Will also take into account if the resource has an analyzer controller based on the analyzer controller property value.

Throws:
SearchEngineException

getAnalyzerMustExist

public Analyzer getAnalyzerMustExist(String analyzerName)
                              throws SearchEngineException
Throws:
SearchEngineException


Copyright (c) 2004-2009 The Compass Project.