Each Domain Specific Data API defines a fixed set of attributes that are essential within its domain, e.g. product titles for Retail or departure dates for Travel. Custom attributes allow to extend the Domain Specific Data API by additional company-specific attributes, e.g. processor_speed is not relevant for each retailer but highly relevant for an electronic store.
This document explains how to use custom attributes.
Overview
Fredhopper requires two UTF-8 encoded CSV files (columns separated by double tabs) to load custom attributes:
- custom_attributes_meta.csv: Describes each custom attribute, e.g. attribute processor_speed is of type float.
- custom_attributes_values.csv: List the actual values for each custom attribute, e.g. 3.6 for processor_speed.
Please ensure that the file names mentioned above are exactly the names of the files you provide to Fredhopper.
|
Content guidelines Ensure for both CSV files:
|
Meta data
Each custom attribute must be defined in the file custom_attributes_meta.csv by the following columns:
| Column | Description | Allow values |
|---|---|---|
| attribute_id | Identifier of the attribute | Must match [a-z0-9_]+. The indexer will enforce this format, rejecting the attribute definition, and possibly the item. We recommend to begin an attribute id with a letter. |
| type | Data type of the attribute. | As specified in Basetype definition |
| locale | Language/country combination for which the name applies | Valid Java Locale, e.g. en_US, fr_FR, de_DE, de_CH |
| name | Language/country specific name of the attribute |
For example:
| attribute_id | type | locale | name |
|---|---|---|---|
| processor_speed | float | en_GB | Processor speed |
| color | set | en_GB | Color |
| color | set | nl_NL | Kleur |
Values
The values for all custom attributes have to be provided in the file custom_attributes_values.csv with the following columns:
| Column | Description | Allow values |
|---|---|---|
| product_id | Identifier of the product | We recommend using identifiers matching [a-z0-9_]+. Refrain from using numeric only identifiers, unless you make sure that ids do not clash between items used in different universes, for example by adding a symbolic prefix to the numeric ids. The indexer will not enforce any format, by default, and hence will accept all item ids. |
| locale | Language/country combination for which the name applies | Valid Java Locale, e.g. en_US, fr_FR, de_DE, de_CH |
| attribute_id | Identifier of the attribute as specified in the meta information. | Must match [a-z0-9_]+. The indexer will enforce this format, rejecting the attribute definition, and possibly the item. We recommend to begin an attribute id with a letter. |
| attribute_value_id | Identifier of the attribute value for types with enumerated, for which one may specify localized alternatives. | We recommend the attribute value id to match [a-z0-9_]+. If not matching, the indexer will convert any offending symbol to its hexadecimal representation. |
| attribute_value | Value of the attribute for the product |
For example:
| product_id | locale | attribute_id | attribute_value_id | attribute_value |
|---|---|---|---|---|
| p_123456 | en_GB | color | blue | blue |
| p_123456 | en_GB | color | red | red |
| p_123456 | nl_NL | color | blue | blauw |
| p_123456 | nl_NL | color | red | rood |
| p_456789 | margin | 10 | ||
| p_456789 | en_GB | promotion_code | discount_10 | 10% discount |
| p_456789 | nl_NL | promotion_code | discount_10 | 10% korting |
Required vs. optional fields
|
Comments
0 comments
Article is closed for comments.