Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class PathHierarchyTokenizerFactory

    Factory for PathHierarchyTokenizer.

    This factory is typically configured for use only in the

    index
    Analyzer (or only in the query Analyzer, but never both).

    For example, in the configuration below a query for Books/NonFic will match documents indexed with values like Books/NonFic, Books/NonFic/Law, Books/NonFic/Science/Physics, etc. But it will not match documents indexed with values like Books, or Books/Fic...

    <fieldType name="descendent_path" class="solr.TextField">
          <analyzer type="index">
            <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
          </analyzer>
          <analyzer type="query">
            <tokenizer class="solr.KeywordTokenizerFactory" />
          </analyzer>
        </fieldType>

    In this example however we see the oposite configuration, so that a query for Books/NonFic/Science/Physics would match documents containing Books/NonFic, Books/NonFic/Science, or Books/NonFic/Science/Physics, but not Books/NonFic/Science/Physics/Theory or Books/NonFic/Law.

    <fieldType name="descendent_path" class="solr.TextField">
          <analyzer type="index">
            <tokenizer class="solr.KeywordTokenizerFactory" />
          </analyzer>
          <analyzer type="query">
            <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
          </analyzer>
        </fieldType>
    Inheritance
    object
    AbstractAnalysisFactory
    TokenizerFactory
    PathHierarchyTokenizerFactory
    Inherited Members
    TokenizerFactory.ForName(string, IDictionary<string, string>)
    TokenizerFactory.LookupClass(string)
    TokenizerFactory.AvailableTokenizers
    TokenizerFactory.ReloadTokenizers()
    TokenizerFactory.Create(TextReader)
    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.Path
    Assembly: Lucene.Net.Analysis.Common.dll
    Syntax
    public class PathHierarchyTokenizerFactory : TokenizerFactory

    Constructors

    PathHierarchyTokenizerFactory(IDictionary<string, string>)

    Creates a new PathHierarchyTokenizerFactory

    Declaration
    public PathHierarchyTokenizerFactory(IDictionary<string, string> args)
    Parameters
    Type Name Description
    IDictionary<string, string> args

    Methods

    Create(AttributeFactory, TextReader)

    Creates a Lucene.Net.Analysis.TokenStream of the specified input using the given Lucene.Net.Util.AttributeSource.AttributeFactory

    Declaration
    public override Tokenizer Create(AttributeSource.AttributeFactory factory, TextReader input)
    Parameters
    Type Name Description
    AttributeSource.AttributeFactory factory
    TextReader input
    Returns
    Type Description
    Tokenizer
    Overrides
    TokenizerFactory.Create(AttributeSource.AttributeFactory, TextReader)
    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.