Overview | Package | Class | Use | Tree | Deprecated | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.lucene.analysis.path
Class PathHierarchyTokenizerFactory

    java.lang.Object
      org.apache.lucene.analysis.util.AbstractAnalysisFactory
          org.apache.lucene.analysis.util.TokenizerFactory
              org.apache.lucene.analysis.path.PathHierarchyTokenizerFactory

    public class PathHierarchyTokenizerFactory

extends TokenizerFactory

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>

Field Summary

Fields inherited from class org.apache.lucene.analysis.util.AbstractAnalysisFactory
`LUCENE_MATCH_VERSION_PARAM, luceneMatchVersion`

Constructor Summary
`PathHierarchyTokenizerFactory(Map<String,String> args)` Creates a new PathHierarchyTokenizerFactory

Method Summary
`Tokenizer` | `create(AttributeSource.AttributeFactory factory, Reader input)` Creates a TokenStream of the specified input using the given AttributeFactory

Methods inherited from class org.apache.lucene.analysis.util.TokenizerFactory
`availableTokenizers, create, forName, lookupClass, reloadTokenizers`

Methods inherited from class org.apache.lucene.analysis.util.AbstractAnalysisFactory
`assureMatchVersion, get, get, get, get, get, getBoolean, getChar, getClassArg, getFloat, getInt, getLines, getLuceneMatchVersion, getOriginalArgs, getPattern, getSet, getSnowballWordSet, getWordSet, isExplicitLuceneMatchVersion, require, require, require, requireBoolean, requireChar, requireFloat, requireInt, setExplicitLuceneMatchVersion, splitFileNames`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PathHierarchyTokenizerFactory

    public PathHierarchyTokenizerFactory(Map<String,String> args)

  Creates a new PathHierarchyTokenizerFactory

Method Detail

### create

    public Tokenizer create(AttributeSource.AttributeFactory factory,
                            Reader input)

  Description copied from class: `TokenizerFactory`
  Creates a TokenStream of the specified input using the given AttributeFactory

  Specified by:
    `create` in class `TokenizerFactory`

Overview | Package | Class | Use | Tree | Deprecated | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.