Fork me on GitHub
  • API

    Show / Hide Table of Contents

    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>
    Inheritance
    object
    AbstractAnalysisFactory
    TokenFilterFactory
    PhoneticFilterFactory
    Implements
    IResourceLoaderAware
    Inherited Members
    TokenFilterFactory.ForName(string, IDictionary<string, string>)
    TokenFilterFactory.LookupClass(string)
    TokenFilterFactory.AvailableTokenFilters
    TokenFilterFactory.ReloadTokenFilters()
    AbstractAnalysisFactory.LUCENE_MATCH_VERSION_PARAM
    AbstractAnalysisFactory.m_luceneMatchVersion
    AbstractAnalysisFactory.OriginalArgs
    AbstractAnalysisFactory.AssureMatchVersion()
    AbstractAnalysisFactory.LuceneMatchVersion
    AbstractAnalysisFactory.Require(IDictionary<string, string>, string)
    AbstractAnalysisFactory.Require(IDictionary<string, string>, string, ICollection<string>)
    AbstractAnalysisFactory.Require(IDictionary<string, string>, string, ICollection<string>, bool)
    AbstractAnalysisFactory.Get(IDictionary<string, string>, string, string)
    AbstractAnalysisFactory.Get(IDictionary<string, string>, string, ICollection<string>)
    AbstractAnalysisFactory.Get(IDictionary<string, string>, string, ICollection<string>, string)
    AbstractAnalysisFactory.Get(IDictionary<string, string>, string, ICollection<string>, string, bool)
    AbstractAnalysisFactory.RequireInt32(IDictionary<string, string>, string)
    AbstractAnalysisFactory.GetInt32(IDictionary<string, string>, string, int)
    AbstractAnalysisFactory.RequireBoolean(IDictionary<string, string>, string)
    AbstractAnalysisFactory.GetBoolean(IDictionary<string, string>, string, bool)
    AbstractAnalysisFactory.RequireSingle(IDictionary<string, string>, string)
    AbstractAnalysisFactory.GetSingle(IDictionary<string, string>, string, float)
    AbstractAnalysisFactory.RequireChar(IDictionary<string, string>, string)
    AbstractAnalysisFactory.GetChar(IDictionary<string, string>, string, char)
    AbstractAnalysisFactory.GetSet(IDictionary<string, string>, string)
    AbstractAnalysisFactory.GetPattern(IDictionary<string, string>, string)
    AbstractAnalysisFactory.GetCulture(IDictionary<string, string>, string, CultureInfo)
    AbstractAnalysisFactory.GetWordSet(IResourceLoader, string, bool)
    AbstractAnalysisFactory.GetLines(IResourceLoader, string)
    AbstractAnalysisFactory.GetSnowballWordSet(IResourceLoader, string, bool)
    AbstractAnalysisFactory.SplitFileNames(string)
    AbstractAnalysisFactory.GetClassArg()
    AbstractAnalysisFactory.IsExplicitLuceneMatchVersion
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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
    PhoneticFilter

    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
    PhoneticFilter

    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
    PhoneticFilter

    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
    PhoneticFilter

    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
    PhoneticFilter

    GetEncoder()

    Must be thread-safe.

    Declaration
    protected virtual IStringEncoder GetEncoder()
    Returns
    Type Description
    IStringEncoder
    See Also
    PhoneticFilter

    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
    PhoneticFilter

    Implements

    Lucene.Net.Analysis.Util.IResourceLoaderAware

    See Also

    PhoneticFilter
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.