Class IndexAnalysisElementsRegistry

java.lang.Object
io.jmix.search.index.mapping.analysis.impl.IndexAnalysisElementsRegistry

@Component("search_IndexAnalysisElementsRegistry") public class IndexAnalysisElementsRegistry extends Object
Contains configurations of all user-defined analysis elements.
  • Field Details

  • Constructor Details

    • IndexAnalysisElementsRegistry

      @Autowired public IndexAnalysisElementsRegistry(List<IndexAnalysisConfigurer> indexAnalysisConfigurers)
  • Method Details

    • getAnalyzer

      @Nullable public AnalysisElementConfiguration getAnalyzer(String name)
    • getNormalizer

      @Nullable public AnalysisElementConfiguration getNormalizer(String name)
    • getTokenizer

      @Nullable public AnalysisElementConfiguration getTokenizer(String name)
    • getCharacterFilter

      @Nullable public AnalysisElementConfiguration getCharacterFilter(String name)
    • getTokenFilter

      @Nullable public AnalysisElementConfiguration getTokenFilter(String name)
    • resolveAllUsedCustomElementsForAnalyzer

      public Set<AnalysisElementConfiguration> resolveAllUsedCustomElementsForAnalyzer(String name)
      Resolves all user-defined analysis elements required for provided analyzer (including itself).
      • If name of modified analyzer is provided - result contains configuration of this analyzer only.
      • If name of completely custom analyzer is provided - result contains configurations of this analyzer and user-defined tokenizer, character filters and token filters. Built-in analysis elements included into user-defined custom analyzer is not present in result.
      • If name of built-in analyzer is provided - result is empty
      Parameters:
      name - name of analyzer
      Returns:
      set of analysis element configurations
    • resolveAllUsedCustomElementsForNormalizer

      public Set<AnalysisElementConfiguration> resolveAllUsedCustomElementsForNormalizer(String name)
      Resolves all user-defined analysis elements required for provided normalizer (including itself).
      • If name of modified normalizer is provided - result contains configuration of this normalizer only.
      • If name of completely custom normalizer is provided - result contains configurations of this normalizer and user-defined character filters and token filters. Built-in analysis elements included into user-defined custom normalizer is not present in result.
      • If name of built-in normalizer is provided - result is empty
      Parameters:
      name - name of normalizer
      Returns:
      set of analysis element configurations
    • resolveAllUsedCustomElements

      protected Set<AnalysisElementConfiguration> resolveAllUsedCustomElements(AnalysisElementConfiguration rootElement)
    • processCustomRootElementConfig

      protected void processCustomRootElementConfig(com.fasterxml.jackson.databind.node.ObjectNode config, Set<AnalysisElementConfiguration> result)
    • fillCustomTokenizer

      protected void fillCustomTokenizer(com.fasterxml.jackson.databind.node.ObjectNode config, Set<AnalysisElementConfiguration> result)
    • fillCustomCharFilters

      protected void fillCustomCharFilters(com.fasterxml.jackson.databind.node.ObjectNode config, Set<AnalysisElementConfiguration> result)
    • fillCustomTokenFilters

      protected void fillCustomTokenFilters(com.fasterxml.jackson.databind.node.ObjectNode config, Set<AnalysisElementConfiguration> result)
    • buildAnalysisElements

      protected Map<String,AnalysisElementConfiguration> buildAnalysisElements(List<? extends io.jmix.search.index.mapping.analysis.impl.AnalysisElementConfigurer> elementConfigurers, String duplicateNameErrorMessage)