Introduction and use cases
Attribute conflation in Fredhopper simplifies how you work with multiple similar attributes that are typically created for different locales or markets, e.g. price_fr, price_de, price_it. Instead of managing each of these attributes separately, attribute conflation enables you to group them into a single logical entity, e.g. price_{locale}. This conflated attribute is then dynamically resolved at runtime based on a defined strategy.
Attribute conflation reduces duplication by allowing you to manage multiple similar attributes as a single logical attribute. This simplifies rule creation, improves performance, and results in a cleaner Business Manager experience. It also makes managing multi-site or multi-region setups much more efficient.
Attribute conflation is useful whenever you have multiple attributes that follow a consistent pattern and represent the same concept across different contexts, such as prices or availabilities for different markets or descriptions for different languages.
Important: The configuration of conflated attributes is usually done by your Technical Consultant. Access to the files required is restricted.
Configuration
Attribute conflation is configured via the multi-site.xml file which must be placed in the config folder.
Note: The sample file multi-site.sample.xml is available as a template. However, only multi-site.xml is used by the system. If multi-site.xml is not present, the functionality is deactivated.
Once the functionality is configured, FAS conflates all attributes that match the specified configuration.
Note: All attributes that include a valid placeholder value in one of the following forms will be conflated: VALUE_attribute (as prefix), attribute_VALUE (as suffix), att_VALUE_ribute (in the middle) .
Fredhopper supports three main strategies for attribute conflation:
- Attribute-based strategy
- Locale-based strategy
- Custom strategy
Attribute-based strategy
This strategy uses the value of a specific attribute to determine which attribute to resolve. You must specify a default value which is used when no value is provided.
Note: The attribute must be of the type set.
Example configuration
<?xml version="1.0" encoding="UTF-8"?>
<config>
<strategy type="attribute">
<attribute name="markets" default-value="fi_fi" />
</strategy>
</config>The configuration above creates the placeholder {markets} which will match all values of the attribute markets, e.g. en_gb. If no value is defined in the query, the default value fi_fi is used.
Example data
Attributes:
new_in_fi_fi, new_in_en_gb, new_in_en_us, as well as fi_fi_price, en_gb_price, en_us_price.
Set-attribute:
markets = {fi_fi, en_gb, en_us}
Results:
This configurations generates the conflated attributes new_in_{markets} and {markets}_price.
The placeholder is dynamically resolved based on the value of the attribute markets in the query.
Locale-based strategy
This strategy uses the locale values to conflate attributes and the selected locale to resolve the conflated attribute.
The locale selection property allows for the selection of the part of the locale that will be used for matching, i.e. language or country.
Warning: If you do not specify the locale selection, only attributes matching the full locale will be conflated, i.e. price_en_gb.
Note: Use the name property to provide a more specific name for the placeholder if you use locale selection.
Example configuration
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:multi-site-config xmlns="http://www.fredhopper.com/schema/fas/multi-site-strategy/1.0 " xmlns:ns2="http://www.fredhopper.com/schema/fas/multi-site/1.0 ">
<strategy type="locale">
<name>country</name>
<default-map-value>de</default-map-value>
<locale-selection>country</locale-selection>
</strategy>
</ns2:multi-site-config>The configuration above creates the placeholder {country} which will match all countries that are part of the locale, e.g. gb in en_gb.
Example data
Attributes:
price_gb_market , price_us_market, price_de_market
Results:
This configuration generates the conflated attribute price_{country}_market.
The placeholder is dynamically resolved based on the country of the selected locale.
Custom strategy
This strategy uses a custom mapping to group and resolve attributes. Keys allow to resolve conflated attribute names based on the resolver provided, while values are used to conflate attributes.
- Attribute resolver: Uses the value from a chosen attribute's value list to define the key that should be used.
- Locale resolver: Uses the value of the selected locale to define the key that should be used.
- Custom trigger resolver: Uses the value of a specified custom trigger to define the key that should be used.
Example configuration
<?xml version="1.0" encoding="UTF-8"?>
<config>
<strategy type="custom">
<name>region</name>
<default-map-value>fi_dk</default-map-value>
<values>
<entry key="pl">pl_cz_sk</entry>
<entry key="cz">pl_cz_sk</entry>
<entry key="sk">pl_cz_sk</entry>
<entry key="dk">fi_dk</entry>
<entry key="fi">fi_dk</entry>
<entry key="de">de_at</entry>
<entry key="at">de_at</entry>
</values>
<resolver type="locale">
<locale-selection>country</locale-selection>
</resolver>
</strategy>
</config>The configuration above creates the placeholder {region}. It uses the resolver type locale, specifically the country information in the locale, to map that information onto the regions used in attribute names.
Example data
Attributes:
rating_pl_cz_sk, rating_fi_dk, rating_de_at
Results:
This configuration generates the conflated attribute rating_{region}.
The placeholder is dynamically resolved based on the country of the selected locale.
Comments
0 comments
Please sign in to leave a comment.