Package io.jmix.search.index.impl
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 typeTJsonp
- the specific for the search client Jsonp type
- Direct Known Subclasses:
ElasticsearchIndexMappingComparator
,OpenSearchIndexMappingComparator
Compares both the mapping from the application's index configuration
and the index state from the search server.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final JsonpSerializer<TJsonp>
protected final MappingFieldComparator
protected final com.fasterxml.jackson.databind.ObjectMapper
-
Constructor Summary
ConstructorDescriptionIndexMappingComparator
(MappingFieldComparator mappingFieldComparator, JsonpSerializer<TJsonp> jsonpSerializer) -
Method Summary
Modifier and TypeMethodDescriptioncompare
(IndexConfiguration indexConfiguration, TState currentIndexState) protected abstract TJsonp
extractTypeMapping
(TState currentIndexState) getAppliedMapping
(TState currentIndexState) getExpectedMapping
(IndexConfiguration indexConfiguration) getFilteredMapping
(Map<String, Object> searchIndexMapping) Removes not necessary tag from serialized mapping.
-
Field Details
-
MAP_TYPE_REF
-
mappingFieldComparator
-
objectMapper
protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper -
jsonpSerializer
-
-
Constructor Details
-
IndexMappingComparator
public IndexMappingComparator(MappingFieldComparator mappingFieldComparator, JsonpSerializer<TJsonp> jsonpSerializer)
-
-
Method Details
-
compare
public MappingComparingResult compare(IndexConfiguration indexConfiguration, TState currentIndexState) -
getExpectedMapping
-
getAppliedMapping
-
extractTypeMapping
-
getFilteredMapping
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
-