Class DynamicAttributesGroupConfiguration.DynamicAttributeGroupDefinitionBuilder
- Enclosing class:
- DynamicAttributesGroupConfiguration
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FieldConfigurationprotected FieldMappingStrategyprotected Class<? extends FieldMappingStrategy>protected static final com.fasterxml.jackson.databind.ObjectMapperprotected Integerprotected PropertyValueExtractorprotected ReferenceAttributesIndexingMode -
Method Summary
Modifier and TypeMethodDescriptionaddParameter(String parameterName, Object parameterValue) Adds new parameter to parameters map.build()excludeCategories(String... categories) excludeProperties(String... properties) Defines entity properties that should NOT be indexed.withFieldConfiguration(com.fasterxml.jackson.databind.node.ObjectNode configuration) Defines field configuration as json object with native configuration.withFieldConfiguration(String configuration) Defines field configuration as String json object with native configuration.withFieldMappingStrategy(FieldMappingStrategy fieldMappingStrategy) DefinesFieldMappingStrategyinstance that should be used to map properties.withFieldMappingStrategyClass(Class<? extends FieldMappingStrategy> fieldMappingStrategyClass) DefinesFieldMappingStrategyimplementation class that should be used to map properties.withOrder(int order) Defines explicit order of theMappingDefinitionfor the field.withParameters(Map<String, Object> parameters) Defines parameters map.withPropertyValueExtractor(PropertyValueExtractor propertyValueExtractor) Defines explicitPropertyValueExtractorthat should be used to extract values from indexed properties.Defines indexing mode for the reference dynamic attributes of the indexing entity
-
Field Details
-
mapper
protected static final com.fasterxml.jackson.databind.ObjectMapper mapper -
fieldMappingStrategyClass
-
fieldMappingStrategy
-
fieldConfiguration
-
propertyValueExtractor
-
parameters
-
referenceAttributesIndexingMode
-
order
-
-
Method Details
-
excludeCategories
public DynamicAttributesGroupConfiguration.DynamicAttributeGroupDefinitionBuilder excludeCategories(String... categories) -
excludeProperties
public DynamicAttributesGroupConfiguration.DynamicAttributeGroupDefinitionBuilder excludeProperties(String... properties) Defines entity properties that should NOT be indexed.Properties should be defined in a full-name format started from the root entity ("localPropertyName", "refPropertyName.propertyName").
Wildcard is allowed at the last level of multilevel properties ("*", "refPropertyName.*").
- Parameters:
properties- property names- Returns:
- builder
-
withFieldMappingStrategyClass
public DynamicAttributesGroupConfiguration.DynamicAttributeGroupDefinitionBuilder withFieldMappingStrategyClass(Class<? extends FieldMappingStrategy> fieldMappingStrategyClass) DefinesFieldMappingStrategyimplementation class that should be used to map properties.Optional - at least one of the followings should be defined:
FieldMappingStrategyimplementation class via this methodFieldMappingStrategyinstance viawithFieldMappingStrategy(io.jmix.search.index.mapping.strategy.FieldMappingStrategy)method- Explicit native configuration via
withFieldConfiguration(java.lang.String)methods
If some of them are defined at the same time:
- Strategy instance takes precedence over strategy class
- Explicit configuration overrides identical parameters of configuration generated by strategy
- Parameters:
fieldMappingStrategyClass- class implementsFieldMappingStrategy- Returns:
- builder
- See Also:
-
withFieldMappingStrategy
public DynamicAttributesGroupConfiguration.DynamicAttributeGroupDefinitionBuilder withFieldMappingStrategy(FieldMappingStrategy fieldMappingStrategy) DefinesFieldMappingStrategyinstance that should be used to map properties.Optional - at least one of the followings should be defined:
FieldMappingStrategyimplementation class viawithFieldMappingStrategyClass(java.lang.Class<? extends io.jmix.search.index.mapping.strategy.FieldMappingStrategy>)methodFieldMappingStrategyinstance via this method- Explicit native configuration via
withFieldConfiguration(java.lang.String)methods
If some of them are defined at the same time:
- Strategy instance takes precedence over strategy class
- Explicit configuration overrides identical parameters of configuration generated by strategy
- Parameters:
fieldMappingStrategy-FieldMappingStrategyinstance- Returns:
- builder
- See Also:
-
withParameters
public DynamicAttributesGroupConfiguration.DynamicAttributeGroupDefinitionBuilder withParameters(Map<String, Object> parameters) Defines parameters map.- Parameters:
parameters- parameters- Returns:
- builder
-
addParameter
public DynamicAttributesGroupConfiguration.DynamicAttributeGroupDefinitionBuilder addParameter(String parameterName, Object parameterValue) Adds new parameter to parameters map.- Parameters:
parameterName- parameter nameparameterValue- parameter value- Returns:
- builder
-
withFieldConfiguration
public DynamicAttributesGroupConfiguration.DynamicAttributeGroupDefinitionBuilder withFieldConfiguration(String configuration) Defines field configuration as String json object with native configuration. It should contain only configuration itself without field name:{ "type": "text", "analyzer": "english", "boost": 2 }Optional - at least one of the followings should be defined:
FieldMappingStrategyimplementation class viawithFieldMappingStrategyClass(java.lang.Class<? extends io.jmix.search.index.mapping.strategy.FieldMappingStrategy>)methodFieldMappingStrategyinstance viawithFieldMappingStrategy(io.jmix.search.index.mapping.strategy.FieldMappingStrategy)method- Explicit native configuration via
withFieldConfiguration(java.lang.String)methods
If some of them are defined at the same time:
- Strategy instance takes precedence over strategy class
- Explicit configuration overrides identical parameters of configuration generated by strategy
- Parameters:
configuration- configuration as json string- Returns:
- builder
- Throws:
RuntimeException- if provided string is not a well-formed json object- See Also:
-
withFieldConfiguration
public DynamicAttributesGroupConfiguration.DynamicAttributeGroupDefinitionBuilder withFieldConfiguration(com.fasterxml.jackson.databind.node.ObjectNode configuration) Defines field configuration as json object with native configuration. It should contain only configuration itself without field name:{ "type": "text", "analyzer": "english", "boost": 2 }Optional - at least one of the followings should be defined:
FieldMappingStrategyimplementation class viawithFieldMappingStrategyClass(java.lang.Class<? extends io.jmix.search.index.mapping.strategy.FieldMappingStrategy>)methodFieldMappingStrategyinstance viawithFieldMappingStrategy(io.jmix.search.index.mapping.strategy.FieldMappingStrategy)method- Explicit native configuration via
withFieldConfiguration(java.lang.String)methods
If some of them are defined at the same time:
- Strategy instance takes precedence over strategy class
- Explicit configuration overrides identical parameters of configuration generated by strategy
- Parameters:
configuration- configuration as json object- Returns:
- builder
- See Also:
-
withPropertyValueExtractor
public DynamicAttributesGroupConfiguration.DynamicAttributeGroupDefinitionBuilder withPropertyValueExtractor(PropertyValueExtractor propertyValueExtractor) Defines explicitPropertyValueExtractorthat should be used to extract values from indexed properties.Required if only explicit field configuration is defined.
Optional if
FieldMappingStrategyis defined (class or instance) - explicit extractor takes precedence over extractor provided by strategy.- Parameters:
propertyValueExtractor- property value extractor- Returns:
- builder
- See Also:
-
withReferenceAttributesIndexingMode
public DynamicAttributesGroupConfiguration.DynamicAttributeGroupDefinitionBuilder withReferenceAttributesIndexingMode(ReferenceAttributesIndexingMode mode) Defines indexing mode for the reference dynamic attributes of the indexing entity- Parameters:
mode- reference attributes indexing mode- Returns:
- builder
-
withOrder
public DynamicAttributesGroupConfiguration.DynamicAttributeGroupDefinitionBuilder withOrder(int order) Defines explicit order of theMappingDefinitionfor the field. TheMappingDefinitionwith the highest order number will be applied. If the order is not specifiedInteger.MIN_VALUEwill be used. It overrides order on strategy -FieldMappingStrategy.getOrder(). If twoMappingDefinitionobjects have the same order the runtime error during the application initialization will occur.- Parameters:
order- the order value to be set for the fields of this descriptor- Returns:
- builder
-
build
-