org.hibernate.search.analyzer.spi

## Interface AnalyzerReference

- All Superinterfaces:
    AutoCloseable, Closeable
  All Known Subinterfaces:
    ScopedAnalyzerReference
  All Known Implementing Classes:
    ElasticsearchAnalyzerReference, LuceneAnalyzerReference, LuceneClassElasticsearchAnalyzerReference, NamedElasticsearch2NormalizerReference, NamedElasticsearch52NormalizerReference, NamedElasticsearchAnalyzerReference, NamedLuceneAnalyzerReference, NamedLuceneNormalizerReference, RemoteAnalyzerReference, ScopedElasticsearchAnalyzerReference, ScopedLuceneAnalyzerReference, SimpleLuceneAnalyzerReference, SimpleLuceneNormalizerReference

      public interface AnalyzerReference
      extends Closeable

  Reference to an analyzer implementation.

  Note that the implementation can be a normalizer (a normalizer is a specific sort of analyzer).

  Author:
    Davide D'Alto
  Experimental
    This type is under active development as part of the Elasticsearch integration. You should be prepared for incompatible changes in future releases.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close analyzer if possible
    `<T extends AnalyzerReference> boolean` | `is(Class<T> analyzerType)` Check if the analyzer can be represented using a specific class.
    `boolean` | `isNormalizer(String fieldName)`
    `<T extends AnalyzerReference> T` | `unwrap(Class<T> analyzerType)` Convert this instance to T

- - ### Method Detail

    - #### isNormalizer

          boolean isNormalizer(String fieldName)

      Parameters:
        `fieldName` - name of the field whose analyzer is to be inspected
      Returns:
        `true` if the analyzer for the field with the given name is a normalizer, `false` otherwise.

    - #### is

          <T extends AnalyzerReference> boolean is(Class<T> analyzerType)

      Check if the analyzer can be represented using a specific class.
      Parameters:
        `analyzerType` - an `AnalyzerReference` type
      Returns:
        true if this implementation can be represented as an instance of T

    - #### unwrap

          <T extends AnalyzerReference> T unwrap(Class<T> analyzerType)

      Convert this instance to T
      Type Parameters:
        `T` - an `AnalyzerReference` type
      Parameters:
        `analyzerType` - the class T
      Returns:
        this instance as T

    - #### close

          void close()

      Close analyzer if possible
      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in interface `Closeable`

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