org.hibernate.search.util.impl
Class ScopedAnalyzer

java.lang.Object
  extended by org.apache.lucene.analysis.Analyzer
      extended by org.hibernate.search.util.impl.ScopedAnalyzer
All Implemented Interfaces:
Closeable

public final class ScopedAnalyzer
extends Analyzer

A ScopedAnalyzer is a wrapper class containing all analyzers for a given class. ScopedAnalyzer behaves similar to PerFieldAnalyzerWrapper by delegating requests for TokenStreams to the underlying Analyzer depending on the requested field name.

Author:
Emmanuel Bernard, Sanne Grinovero

Constructor Summary
ScopedAnalyzer()
           
 
Method Summary
 void addScopedAnalyzer(String scope, Analyzer scopedAnalyzer)
           
 ScopedAnalyzer clone()
           
 int getOffsetGap(Fieldable field)
           
 int getPositionIncrementGap(String fieldName)
           
 TokenStream reusableTokenStream(String fieldName, Reader reader)
           
 void setGlobalAnalyzer(Analyzer globalAnalyzer)
           
 TokenStream tokenStream(String fieldName, Reader reader)
           
 
Methods inherited from class org.apache.lucene.analysis.Analyzer
close, getPreviousTokenStream, setPreviousTokenStream
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScopedAnalyzer

public ScopedAnalyzer()
Method Detail

setGlobalAnalyzer

public void setGlobalAnalyzer(Analyzer globalAnalyzer)

addScopedAnalyzer

public void addScopedAnalyzer(String scope,
                              Analyzer scopedAnalyzer)

tokenStream

public TokenStream tokenStream(String fieldName,
                               Reader reader)
Specified by:
tokenStream in class Analyzer

reusableTokenStream

public TokenStream reusableTokenStream(String fieldName,
                                       Reader reader)
                                throws IOException
Overrides:
reusableTokenStream in class Analyzer
Throws:
IOException

getPositionIncrementGap

public int getPositionIncrementGap(String fieldName)
Overrides:
getPositionIncrementGap in class Analyzer

getOffsetGap

public int getOffsetGap(Fieldable field)
Overrides:
getOffsetGap in class Analyzer

clone

public ScopedAnalyzer clone()
Overrides:
clone in class Object


Copyright © 2006-2013 Red Hat, Inc. All Rights Reserved