Class PhoneticFilterFactory
Factory for PhoneticFilter.
Create tokens based on phonetic encoders from the Language namespace. This takes one required argument, "encoder", and the rest are optional:- encoder required, one of "DoubleMetaphone", "Metaphone", "Soundex", "RefinedSoundex", "Caverphone" (v2.0), or "ColognePhonetic" (case insensitive). If encoder isn't one of these, it'll be resolved as a class name either by itself if it already contains a '.' or otherwise as in the same package as these others.
- inject (default=true) add tokens to the stream with the offset=0
- maxCodeLength The maximum length of the phonetic codes, as defined by the encoder. If an encoder doesn't support this then specifying this is an error.
<fieldType name="text_phonetic" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.PhoneticFilterFactory" encoder="DoubleMetaphone" inject="true"/>
</analyzer>
</fieldType>
Implements
IResourceLoaderAware
Inherited Members
TokenFilterFactory.AvailableTokenFilters
TokenFilterFactory.ReloadTokenFilters()
AbstractAnalysisFactory.LUCENE_MATCH_VERSION_PARAM
AbstractAnalysisFactory.m_luceneMatchVersion
AbstractAnalysisFactory.OriginalArgs
AbstractAnalysisFactory.AssureMatchVersion()
AbstractAnalysisFactory.LuceneMatchVersion
AbstractAnalysisFactory.GetClassArg()
AbstractAnalysisFactory.IsExplicitLuceneMatchVersion
Namespace: Lucene.Net.Analysis.Phonetic
Assembly: Lucene.Net.Analysis.Phonetic.dll
Syntax
public class PhoneticFilterFactory : TokenFilterFactory, IResourceLoaderAware
Constructors
PhoneticFilterFactory(IDictionary<string, string>)
Creates a new PhoneticFilterFactory.
Declaration
public PhoneticFilterFactory(IDictionary<string, string> args)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<string, string> | args |
See Also
Fields
ENCODER
parameter name: either a short name or a full class name
Declaration
public const string ENCODER = "encoder"
Field Value
Type | Description |
---|---|
string |
See Also
INJECT
parameter name: true if encoded tokens should be added as synonyms
Declaration
public const string INJECT = "inject"
Field Value
Type | Description |
---|---|
string |
See Also
MAX_CODE_LENGTH
Factory for PhoneticFilter.
Create tokens based on phonetic encoders from the Language namespace. This takes one required argument, "encoder", and the rest are optional:- encoder required, one of "DoubleMetaphone", "Metaphone", "Soundex", "RefinedSoundex", "Caverphone" (v2.0), or "ColognePhonetic" (case insensitive). If encoder isn't one of these, it'll be resolved as a class name either by itself if it already contains a '.' or otherwise as in the same package as these others.
- inject (default=true) add tokens to the stream with the offset=0
- maxCodeLength The maximum length of the phonetic codes, as defined by the encoder. If an encoder doesn't support this then specifying this is an error.
<fieldType name="text_phonetic" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.PhoneticFilterFactory" encoder="DoubleMetaphone" inject="true"/>
</analyzer>
</fieldType>
Declaration
public const string MAX_CODE_LENGTH = "maxCodeLength"
Field Value
Type | Description |
---|---|
string |
See Also
Methods
Create(TokenStream)
Transform the specified input Lucene.Net.Analysis.TokenStream
Declaration
public override TokenStream Create(TokenStream input)
Parameters
Type | Name | Description |
---|---|---|
TokenStream | input |
Returns
Type | Description |
---|---|
TokenStream |
Overrides
Lucene.Net.Analysis.Util.TokenFilterFactory.Create(Lucene.Net.Analysis.TokenStream)
See Also
GetEncoder()
Must be thread-safe.
Declaration
protected virtual IStringEncoder GetEncoder()
Returns
Type | Description |
---|---|
IStringEncoder |
See Also
Inform(IResourceLoader)
Initializes this component with the provided Lucene.Net.Analysis.Util.IResourceLoader (used for loading types, embedded resources, files, etc).
Declaration
public virtual void Inform(IResourceLoader loader)
Parameters
Type | Name | Description |
---|---|---|
IResourceLoader | loader |
See Also
Implements
Lucene.Net.Analysis.Util.IResourceLoaderAware