Class IndexMappingComparator<TState,TJsonp>

java.lang.Object
io.jmix.search.index.impl.IndexMappingComparator<TState,TJsonp>
Type Parameters:
TState - the received from the server index state type
TJsonp - the specific for the search client Jsonp type
Direct Known Subclasses:
ElasticsearchIndexMappingComparator, OpenSearchIndexMappingComparator

public abstract class IndexMappingComparator<TState,TJsonp> extends Object
Compares both the mapping from the application's index configuration and the index state from the search server.
  • Field Details

    • MAP_TYPE_REF

      protected static final com.fasterxml.jackson.core.type.TypeReference<Map<String,Object>> MAP_TYPE_REF
    • mappingFieldComparator

      protected final MappingFieldComparator mappingFieldComparator
    • objectMapper

      protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
    • jsonpSerializer

      protected final JsonpSerializer<TJsonp> jsonpSerializer
  • Constructor Details

  • Method Details

    • compare

      public MappingComparingResult compare(IndexConfiguration indexConfiguration, TState currentIndexState)
    • getExpectedMapping

      protected Map<String,Object> getExpectedMapping(IndexConfiguration indexConfiguration)
    • getAppliedMapping

      protected Map<String,Object> getAppliedMapping(TState currentIndexState)
    • extractTypeMapping

      @Nullable protected abstract TJsonp extractTypeMapping(TState currentIndexState)
    • getFilteredMapping

      protected static Map<String,Object> getFilteredMapping(Map<String,Object> searchIndexMapping)
      Removes not necessary tag from serialized mapping. This tag is added by the 'client' of the search engine.
      Parameters:
      searchIndexMapping - - serialized mapping with not necessary 'type: object' elements
      Returns:
      filtered mapping without 'type: object' elements