|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Target(value=PACKAGE) @Retention(value=RUNTIME) public @interface SearchAnalyzer
Configure Analyzer to be used within Compass.
Set on package definition (package-info.java).
The Analyzer is registed under a lookup name (name()), which can then
be reference in the different mapping definitions.
Allows for simple configuration of all analyzers that come with Compass using type().
If the type() is set to AnalyzerType.Snowball, the 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 type(),
and the 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 addStopWords() is set to true.
Further settings can be set for a specialized analyzer using settings(). If the
specialized Analyzer requires settings to be injected, it needs to implement the
CompassConfigurable interface.
To replace Compas default analyzer, the name() should be set
LuceneEnvironment.Analyzer.DEFAULT_GROUP.
To replace Compass search analyzer (which defaults to the default analyzer if not set), the
name() should be set to LuceneEnvironment.Analyzer.SEARCH_GROUP.
Multiple analyzers can be defined using the SearchAnalyzers annotation.
Note, that Analyzers can also be conifugred using other Compass configuration mechanism.
| Required Element Summary | |
|---|---|
String |
name
The name the analyzer will be registered under. |
AnalyzerType |
type
The type of the analyzer. |
| Optional Element Summary | |
|---|---|
boolean |
addStopWords
Add the set of stopWords() to the default set of stop words if set to true. |
Class<? extends Analyzer> |
analyzerClass
The custom Analyzer implementation. |
String[] |
filters
A set of LuceneAnalyzerTokenFilterProviders
lookup names to be used with the Analyzer. |
SearchSetting[] |
settings
Further settings for a custom Analyzer implementation. |
SnowballType |
snowballType
If the type() is set to AnalyzerType.Snowball, controls
the snowball analyzer type. |
String[] |
stopWords
A set of stop words that will be added/replace the stop words that comes with Compass intenral analyzers. |
| Element Detail |
|---|
public abstract String name
public abstract AnalyzerType type
Analyzer implementation
the AnalyzerType.CustomAnalyzer should be set, and the analyzerClass()
should have the custom Analyzer class set.
public abstract SnowballType snowballType
type() is set to AnalyzerType.Snowball, controls
the snowball analyzer type.
public abstract Class<? extends Analyzer> analyzerClass
Analyzer implementation. Used when the type()
is set to AnalyzerType.CustomAnalyzer.
public abstract String[] filters
LuceneAnalyzerTokenFilterProviders
lookup names to be used with the Analyzer.
Filters can be configured using SearchAnalyzerFilter or using Compass configuration.
public abstract String[] stopWords
Only applies when using one of Compass internal analyzer types, and not the AnalyzerType.CustomAnalyzer.
public abstract boolean addStopWords
stopWords() to the default set of stop words if set to true.
Replaces them if set to false.
Only applies when using one of Compass internal analyzer types, and not the AnalyzerType.CustomAnalyzer.
public abstract SearchSetting[] settings
Analyzer implementation.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||