org.hibernate.search.analyzer.impl

## Class ScopedLuceneAnalyzer

- java.lang.Object
- - org.apache.lucene.analysis.Analyzer
  - - org.apache.lucene.analysis.AnalyzerWrapper
    - - org.hibernate.search.analyzer.impl.ScopedLuceneAnalyzer

- All Implemented Interfaces:
    Closeable, AutoCloseable

      public final class ScopedLuceneAnalyzer
      extends AnalyzerWrapper

  A `ScopedLuceneAnalyzer` is a wrapper class containing all analyzers for a given class. `ScopedLuceneAnalyzer` behaves similar to `PerFieldAnalyzerWrapper` by delegating requests for `TokenStream`s to the underlying `Analyzer` depending on the requested field name.
  Author:
    Emmanuel Bernard, Sanne Grinovero

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.lucene.analysis.Analyzer

      `Analyzer.ReuseStrategy, Analyzer.TokenStreamComponents`

  - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.analysis.Analyzer

      `GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ScopedLuceneAnalyzer(Analyzer globalAnalyzer)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Analyzer` | `getWrappedAnalyzer(String fieldName)`
    `boolean` | `isCompositeOfSameInstances(ScopedLuceneAnalyzer other)` Compares the references of the global analyzer backing this ScopedAnalyzer and each scoped analyzer.
    `String` | `toString()`

    - ### Methods inherited from class org.apache.lucene.analysis.AnalyzerWrapper

      `createComponents, getOffsetGap, getPositionIncrementGap, initReader, wrapComponents, wrapReader`

    - ### Methods inherited from class org.apache.lucene.analysis.Analyzer

      `close, getReuseStrategy, getVersion, setVersion, tokenStream, tokenStream`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ScopedLuceneAnalyzer

          public ScopedLuceneAnalyzer(Analyzer globalAnalyzer)

  - ### Method Detail

    - #### isCompositeOfSameInstances

          public boolean isCompositeOfSameInstances(ScopedLuceneAnalyzer other)

      Compares the references of the global analyzer backing this ScopedAnalyzer and each scoped analyzer.
      Parameters:
        `other` - ScopedAnalyzer to compare to
      Returns:
        true if and only if the same instance of global analyzer is being used and all scoped analyzers also match, by reference.

    - #### getWrappedAnalyzer

          protected Analyzer getWrappedAnalyzer(String fieldName)

      Specified by:
        `getWrappedAnalyzer` in class `AnalyzerWrapper`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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