Configure
Analyzer to be used within Compass.
Set on package definition (package-info.java ).
The
Analyzer is registed under a lookup name (
SearchAnalyzer.name() ), which can then
be reference in the different mapping definitions.
Allows for simple configuration of all analyzers that come with Compass using
SearchAnalyzer.type() .
If the
SearchAnalyzer.type() is set to
AnalyzerType.Snowball , the
SearchAnalyzer.snowballType() can be used to further configure the snowball analyzer. If a custom converter needs to be
registered with Compass, the
AnalyzerType.CustomAnalyzer needs to be set on
SearchAnalyzer.type() ,
and the
SearchAnalyzer.analyzerClass() needs to be configured with the class that implements it.
A set of stop words can be added/replace the stop words the internal analyzers are configured
with. The stop words will be added if the
SearchAnalyzer.addStopWords() is set to true .
Further settings can be set for a specialized analyzer using
SearchAnalyzer.settings() . If the
specialized
Analyzer requires settings to be injected, it needs to implement the
org.compass.core.config.CompassConfigurable interface.
To replace Compas default analyzer, the
SearchAnalyzer.name() should be set
org.compass.core.lucene.LuceneEnvironment.Analyzer.DEFAULT_GROUP .
To replace Compass search analyzer (which defaults to the default analyzer if not set), the
SearchAnalyzer.name() should be set to
org.compass.core.lucene.LuceneEnvironment.Analyzer.SEARCH_GROUP .
Multiple analyzers can be defined using the
SearchAnalyzers annotation.
Note, that Analyzers can also be conifugred using Compass configuration mechanism.
author: kimchy |