org.hibernate.search.analyzer.spi

## Interface AnalyzerStrategy

- All Known Implementing Classes:
    Elasticsearch2AnalyzerStrategy, Elasticsearch52AnalyzerStrategy, LuceneEmbeddedAnalyzerStrategy

      public interface AnalyzerStrategy

  A strategy for applying analyzers.
  Author:
    Gunnar Morling, Yoann Rodiere
  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
    --- | ---
    `ScopedAnalyzerReference.Builder` | `buildScopedAnalyzerReference(AnalyzerReference initialGlobalAnalyzerReference)` Creates a `ScopedAnalyzerReference` builder.
    `AnalyzerReference` | `createDefaultAnalyzerReference()`
    `AnalyzerReference` | `createLuceneClassAnalyzerReference(Class<?> analyzerClass)`
    `AnalyzerReference` | `createLuceneClassNormalizerReference(Class<?> analyzerClass)`
    `AnalyzerReference` | `createNamedAnalyzerReference(String name)`
    `AnalyzerReference` | `createNamedNormalizerReference(String name)`
    `AnalyzerReference` | `createPassThroughAnalyzerReference()`
    `Map<String,AnalyzerReference>` | `createProvidedAnalyzerReferences()`
    `Map<String,AnalyzerReference>` | `createProvidedNormalizerReferences()`
    `void` | `initializeReferences(Collection<AnalyzerReference> analyzerReferences, Map<String,AnalyzerDef> mappingAnalyzerDefinitions, Collection<AnalyzerReference> normalizerReferences, Map<String,NormalizerDef> mappingNormalizerDefinitions)` Initializes references created by this strategy, i.e.

- - ### Method Detail

    - #### createDefaultAnalyzerReference

          AnalyzerReference createDefaultAnalyzerReference()

      Returns:
        a reference to the default analyzer, the one to be used when no specific configuration is set on a given field.

    - #### createPassThroughAnalyzerReference

          AnalyzerReference createPassThroughAnalyzerReference()

      Returns:
        a reference to an analyzer that applies no operation whatsoever to the flux. This is useful for queries operating on non-tokenized fields.

    - #### createProvidedAnalyzerReferences

          Map<String,AnalyzerReference> createProvidedAnalyzerReferences()

      Returns:
        a map of named references to provided analyzers, i.e. those that we know for sure will be available.

    - #### createNamedAnalyzerReference

          AnalyzerReference createNamedAnalyzerReference(String name)

      Parameters:
        `name` - The name of the analyzer to be referenced.
      Returns:
        a reference that will be `initialized later`.

    - #### createLuceneClassAnalyzerReference

          AnalyzerReference createLuceneClassAnalyzerReference(Class<?> analyzerClass)

      Parameters:
        `analyzerClass` - The analyzer class the reference should reference.
      Returns:
        a reference to an instance of the given analyzer class that will be `initialized later`.

    - #### createProvidedNormalizerReferences

          Map<String,AnalyzerReference> createProvidedNormalizerReferences()

      Returns:
        a map of named references to provided normalizers, i.e. those that we know for sure will be available.

    - #### createNamedNormalizerReference

          AnalyzerReference createNamedNormalizerReference(String name)

      Parameters:
        `name` - The name of the normalizer to be referenced.
      Returns:
        a reference that will be `initialized later`.

    - #### createLuceneClassNormalizerReference

          AnalyzerReference createLuceneClassNormalizerReference(Class<?> analyzerClass)

      Parameters:
        `analyzerClass` - The analyzer class the reference should reference.
      Returns:
        a reference to an instance of the given analyzer class that will be `initialized later`.

    - #### initializeReferences

          void initializeReferences(Collection<AnalyzerReference> analyzerReferences,
                                    Map<String,AnalyzerDef> mappingAnalyzerDefinitions,
                                    Collection<AnalyzerReference> normalizerReferences,
                                    Map<String,NormalizerDef> mappingNormalizerDefinitions)

      Initializes references created by this strategy, i.e. make them point to the actual analyzer/normalizer definition.
      Parameters:
        `analyzerReferences` - The analyzer references to initialize, gathered through calls to methods of this strategy.
        `mappingAnalyzerDefinitions` - The analyzer definitions gathered through the Hibernate Search mappings.
        `normalizerReferences` - The normalizer references to initialize, gathered through calls to methods of this strategy.
        `mappingNormalizerDefinitions` - The normalizer definitions gathered through the Hibernate Search mappings.

    - #### buildScopedAnalyzerReference

          ScopedAnalyzerReference.Builder buildScopedAnalyzerReference(AnalyzerReference initialGlobalAnalyzerReference)

      Creates a `ScopedAnalyzerReference` builder.
      Parameters:
        `initialGlobalAnalyzerReference` - The global analyzer to set initially on the builder.
      Returns:
        A `ScopedAnalyzerReference` builder. The returned reference will be `initialized later`.

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