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
    System.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>, Boolean)
    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, Boolean)
    AbstractAnalysisFactory.RequireInt32(IDictionary<String, String>, String)
    AbstractAnalysisFactory.GetInt32(IDictionary<String, String>, String, Int32)
    AbstractAnalysisFactory.RequireBoolean(IDictionary<String, String>, String)
    AbstractAnalysisFactory.GetBoolean(IDictionary<String, String>, String, Boolean)
    AbstractAnalysisFactory.RequireSingle(IDictionary<String, String>, String)
    AbstractAnalysisFactory.GetSingle(IDictionary<String, String>, String, Single)
    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, Boolean)
    AbstractAnalysisFactory.GetLines(IResourceLoader, String)
    AbstractAnalysisFactory.GetSnowballWordSet(IResourceLoader, String, Boolean)
    AbstractAnalysisFactory.SplitFileNames(String)
    AbstractAnalysisFactory.GetClassArg()
    AbstractAnalysisFactory.IsExplicitLuceneMatchVersion
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Lucene.Net.Analysis.Path
    Assembly: Lucene.Net.Analysis.Common.dll
    Syntax
    public class PathHierarchyTokenizerFactory : TokenizerFactory

    Constructors

    | Improve this Doc View Source

    PathHierarchyTokenizerFactory(IDictionary<String, String>)

    Creates a new PathHierarchyTokenizerFactory

    Declaration
    public PathHierarchyTokenizerFactory(IDictionary<string, string> args)
    Parameters
    Type Name Description
    System.Collections.Generic.IDictionary<System.String, System.String> args

    Methods

    | Improve this Doc View Source

    Create(AttributeSource.AttributeFactory, TextReader)

    Declaration
    public override Tokenizer Create(AttributeSource.AttributeFactory factory, TextReader input)
    Parameters
    Type Name Description
    Lucene.Net.Util.AttributeSource.AttributeFactory factory
    System.IO.TextReader input
    Returns
    Type Description
    Lucene.Net.Analysis.Tokenizer
    Overrides
    TokenizerFactory.Create(AttributeSource.AttributeFactory, TextReader)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 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.