Class AutoMappingStrategy
java.lang.Object
io.jmix.search.index.mapping.strategy.impl.AutoMappingStrategy
- All Implemented Interfaces:
FieldMappingStrategy
@Component("search_AutoMappingStrategy")
public class AutoMappingStrategy
extends Object
implements FieldMappingStrategy
Strategy that automatically maps properties the most common way.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final FieldMapperProvider
protected final PropertyValueExtractorProvider
-
Constructor Summary
ConstructorDescriptionAutoMappingStrategy
(PropertyValueExtractorProvider propertyValueExtractorProvider, FieldMapperProvider fieldMapperProvider) -
Method Summary
Modifier and TypeMethodDescriptioncreateFieldConfiguration
(MetaPropertyPath propertyPath, Map<String, Object> parameters) Creates field configuration as Elasticsearch-native json.int
getOrder()
Defines the order of mapping strategy.getPropertyValueExtractor
(MetaPropertyPath propertyPath) ProvidesPropertyValueExtractor
to extract property value from entity instancesprotected boolean
hasFieldMapper
(MetaPropertyPath propertyPath) protected boolean
hasPropertyValueExtractor
(MetaPropertyPath propertyPath) boolean
isSupported
(MetaPropertyPath propertyPath) Checks is providedMetaPropertyPath
is supported by this mapping strategyprotected Optional<FieldMapper>
resolveFieldMapper
(MetaPropertyPath propertyPath) protected Optional<PropertyValueExtractor>
resolvePropertyValueExtractor
(MetaPropertyPath propertyPath)
-
Field Details
-
propertyValueExtractorProvider
-
fieldMapperProvider
-
-
Constructor Details
-
AutoMappingStrategy
@Autowired public AutoMappingStrategy(PropertyValueExtractorProvider propertyValueExtractorProvider, FieldMapperProvider fieldMapperProvider)
-
-
Method Details
-
getOrder
public int getOrder()Description copied from interface:FieldMappingStrategy
Defines the order of mapping strategy. If several strategies match the same property strategy with the latest order will be used- Specified by:
getOrder
in interfaceFieldMappingStrategy
- Returns:
- order
-
isSupported
Description copied from interface:FieldMappingStrategy
Checks is providedMetaPropertyPath
is supported by this mapping strategy- Specified by:
isSupported
in interfaceFieldMappingStrategy
- Parameters:
propertyPath
- property to check- Returns:
- true if provided
MetaPropertyPath
is supported, false otherwise
-
createFieldConfiguration
public FieldConfiguration createFieldConfiguration(MetaPropertyPath propertyPath, Map<String, Object> parameters) Description copied from interface:FieldMappingStrategy
Creates field configuration as Elasticsearch-native json.- Specified by:
createFieldConfiguration
in interfaceFieldMappingStrategy
- Parameters:
propertyPath
- property to generate configuration forparameters
- input parameters- Returns:
FieldConfiguration
-
getPropertyValueExtractor
Description copied from interface:FieldMappingStrategy
ProvidesPropertyValueExtractor
to extract property value from entity instances- Specified by:
getPropertyValueExtractor
in interfaceFieldMappingStrategy
- Parameters:
propertyPath
- property- Returns:
PropertyValueExtractor
-
hasFieldMapper
-
hasPropertyValueExtractor
-
resolveFieldMapper
-
resolvePropertyValueExtractor
protected Optional<PropertyValueExtractor> resolvePropertyValueExtractor(MetaPropertyPath propertyPath)
-