org.hibernate.search.elasticsearch.analyzer.definition.impl

## Class NamespaceMergingElasticsearchAnalysisDefinitionRegistry

- java.lang.Object
- - org.hibernate.search.elasticsearch.analyzer.definition.impl.ForwardingElasticsearchAnalysisDefinitionRegistry
  - - org.hibernate.search.elasticsearch.analyzer.definition.impl.NamespaceMergingElasticsearchAnalysisDefinitionRegistry

- All Implemented Interfaces:
    ElasticsearchAnalysisDefinitionRegistry

      public final class NamespaceMergingElasticsearchAnalysisDefinitionRegistry
      extends ForwardingElasticsearchAnalysisDefinitionRegistry

  A wrapper around an `ElasticsearchAnalysisDefinitionRegistry` that automatically checks that newly inserted analyzers/normalizers do not introduce naming conflicts between normalizers and analyzers, effectively merging the analyzer and normalizer namespace.

  For instance, a `SimpleElasticsearchAnalysisDefinitionRegistry` would allow both an analyzer and a normalizer to be named "standard" at the same time. Adding this wrapper around the registry would prevent this situation to ever occur: the insertion of the analyzer or normalizer (whichever happens last) would trigger an exception.

  Author:
    Yoann Rodiere

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NamespaceMergingElasticsearchAnalysisDefinitionRegistry(ElasticsearchAnalysisDefinitionRegistry delegate)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `register(String name, AnalyzerDefinition definition)` Register an analyzer definition.
    `void` | `register(String name, NormalizerDefinition definition)` Register a normalizer definition.

    - ### Methods inherited from class org.hibernate.search.elasticsearch.analyzer.definition.impl.ForwardingElasticsearchAnalysisDefinitionRegistry

      `getAnalyzerDefinition, getCharFilterDefinition, getNormalizerDefinition, getTokenFilterDefinition, getTokenizerDefinition, register, register, register`

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

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

- - ### Constructor Detail

    - #### NamespaceMergingElasticsearchAnalysisDefinitionRegistry

          public NamespaceMergingElasticsearchAnalysisDefinitionRegistry(ElasticsearchAnalysisDefinitionRegistry delegate)

  - ### Method Detail

    - #### register

          public void register(String name,
                               AnalyzerDefinition definition)

      Description copied from interface: `ElasticsearchAnalysisDefinitionRegistry`
      Register an analyzer definition.
      Specified by:
        `register` in interface `ElasticsearchAnalysisDefinitionRegistry`
      Overrides:
        `register` in class `ForwardingElasticsearchAnalysisDefinitionRegistry`
      Parameters:
        `name` - The name of the definition to be registered.
        `definition` - The definition to be registered.

    - #### register

          public void register(String name,
                               NormalizerDefinition definition)

      Description copied from interface: `ElasticsearchAnalysisDefinitionRegistry`
      Register a normalizer definition.
      Specified by:
        `register` in interface `ElasticsearchAnalysisDefinitionRegistry`
      Overrides:
        `register` in class `ForwardingElasticsearchAnalysisDefinitionRegistry`
      Parameters:
        `name` - The name of the definition to be registered.
        `definition` - The definition to be registered.

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