|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.gouv.culture.sdx.search.lucene.analysis.AnalyzerManager
Utility class for managing Lucene analyzers in a multilingual context.
Lucene analyzers are used for indexing and querying a Lucene index. An analyzer is specific to a language, so in a multilingual context we need a way to manage analyzers.
Most SDX applications will share the same analyzers for popular languages and contexts. In order to reuse resources, we will create only one AnalyzerManager and attach it to the framework.
Analyzers used within this manager will each have a unique key. This key will be a combination of the locale and the configuration file used.
Constructor Summary | |
AnalyzerManager()
Builds a manager. |
Method Summary | |
void |
compose(org.apache.avalon.framework.component.ComponentManager manager)
Sets the pipeline's ComponentManager. |
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
Configures the manager. |
void |
enableLogging(org.apache.avalon.framework.logger.Logger logger)
Sets the logger. |
Analyzer |
getAnalyzer(java.util.Locale locale,
java.io.File configurationFile)
Adds an analyzer given a locale and a configuration file. |
Analyzer |
getAnalyzer(java.lang.String className,
java.io.File configurationFile)
Adds an analyzer using a specific class name and a configuration file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AnalyzerManager()
Only one manager is needed for a running SDX installation. It is created and managed by the SDX framework.
Method Detail |
public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
enableLogging
in interface org.apache.avalon.framework.logger.LogEnabled
logger
- The logger to use.public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
For now, no specific configuration is needed.
configure
in interface org.apache.avalon.framework.configuration.Configurable
org.apache.avalon.framework.configuration.ConfigurationException
public Analyzer getAnalyzer(java.util.Locale locale, java.io.File configurationFile) throws SDXException
locale
- The givene locale, cannot be nullconfigurationFile
- An XML file for configuring the analyzer (may be null)
SDXException
public Analyzer getAnalyzer(java.lang.String className, java.io.File configurationFile) throws SDXException
className
- The name of the class to use.configurationFile
- The configuration file for the analyzer (may be null)
SDXException
public void compose(org.apache.avalon.framework.component.ComponentManager manager) throws org.apache.avalon.framework.component.ComponentException
compose
in interface org.apache.avalon.framework.component.Composable
manager
- The ComponentManager to use.
org.apache.avalon.framework.component.ComponentException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |