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

java.lang.Object
  extended by org.compass.core.lucene.engine.analyzer.DefaultLuceneAnalyzerFactory
All Implemented Interfaces:
LuceneAnalyzerFactory

public class DefaultLuceneAnalyzerFactory
extends Object
implements LuceneAnalyzerFactory

Author:
kimchy

Constructor Summary
DefaultLuceneAnalyzerFactory()
           
 
Method Summary
 Analyzer createAnalyzer(String analyzerName, CompassSettings settings)
          Creates a thread safe analyzer instance to be used.
 String[] parseStopWords(String analyzerName, CompassSettings settings, String[] defaultStopWords)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLuceneAnalyzerFactory

public DefaultLuceneAnalyzerFactory()
Method Detail

createAnalyzer

public Analyzer createAnalyzer(String analyzerName,
                               CompassSettings settings)
                        throws SearchEngineException
Description copied from interface: LuceneAnalyzerFactory
Creates a thread safe analyzer instance to be used. The factory is given the analyzer name and the settings that are relevant for that analyzer.

For example, setting compass.engine.analyzer.[analyzer name].factory with the factory class name (or the actual instance of the factory) will use the factory to create the actual instance of the analyzer.

The settings are the one bounded to the specific analyzer. For examle, a setting under the key: compass.engine.analyzer.[analyzer name].key1=prop1 will be injected as key1=prop1. The global settings can still be accessed using CompassSettings.getGloablSettings().

Specified by:
createAnalyzer in interface LuceneAnalyzerFactory
Parameters:
analyzerName - The analyzer name
settings - The settings boudned to the specific analyzer
Returns:
An instnace of Lucene Analyzer
Throws:
SearchEngineException

parseStopWords

public String[] parseStopWords(String analyzerName,
                               CompassSettings settings,
                               String[] defaultStopWords)


Copyright (c) 2004-2009 The Compass Project.