Fredhopper basetypes are an essential part of your data integration. This article explains the supported
Fredhopper basetypes
| Fredhopper has created a decision tree that will help you pick the correct basetype for an attribute: Choosing the correct Fredhopper basetype |
| Basetype names are case-sensitive and should be entirely in lower case. Otherwise, it may result in the rejection of any items that utilize the attribute in question. |
| Basetype | Value range | When to use | Note | ||
|---|---|---|---|---|---|
| int | Between 0 and Integer.MAX_VALUE | If discrete values can be counted | The int data type is intended for non-negative integer attribute values (0, 1, 2, 10, ...) which can be used for (bracketed) facets and sorting on e.g. stock amounts, ratings, etc. | ||
| float | Between 0.00001 and Float.MAX_VALUE 0.0 as a special value |
Numerical data that cannot be encoded as integer | The float data type can hold positive floating point numbers (0.1, 12.6767676, ....) and is typically used for bracketed facets and sorting on prices, margin, discounts etc. Value '0.0' is not recommended but technically allowed. Negative values will be considered as undefined. | ||
| list | 1 out of n values (n = 32765) |
The List data type represents one of a fixed list of values. List attributes have locale independent value identifiers (typically the lowercase English representation or database id of a value) and multi-lingual, locale dependent display values. Identifiers should be unique to the attribute and not contain spaces, upper case characters or any special characters (,"/\ etc.). Basically the identifiers may contain the letters a to z and an underscore (_). _12345 is ok |
|||
| list64 | 1 out of 64 values | Same as list. If the attribute has a maximum of 64 different values list64 is more efficient in terms of memory usage and performance than a list attribute. | |||
| set | 1..n out of n values (n = 32765) | The Set data type is identical to the list but per item this attribute can have more than 1 value. Lists and sets are typically used for facets.
|
|||
| set64 | 1..64 out of 64 values | Same as set. If the attribute has a maximum of 64 different values set64 is more efficient in terms of memory usage and performance than a set attribute | |||
| hierarchical | nested categories | The hierarchical data type is used for categorization (classification) of the items. An item should at least have one hierarchical attribute, and this attribute is always named categories. Categories can have child categories which can in turn have child categories. The number of children (levels) is not limited and does not have to be the same across all categories. Items can exist in one or more categories. The top level category value is called universe. Fredhopper supports only one hierarchical attribute per universe. | |||
| text | any unicode string, must be shorter than 32768 characters | not multi lingual, but possible to navigate on (typical list of authors, names) | The Text type is a data type without locale specific values, i.e. its value is the same across all locales. It is typically used for product codes that are locale independent and need to be displayed or free text searchable. As of FAS6.1 it will be possible to create a facet / sort on a text type. However, it is recommended to use list and set attributes for facets only as they perform better and text does not allow multi select facets. Further, the values won't be shown in a dropdown for the e.g. Item Campaign Filters, so one would have to rely on manually typing them | ||
| asset | any multi lingual value | Used as source data for search and display | The Asset data type holds multilingual free text data and is meant for free text search and display purposes. Typical examples of this are product descriptions or image references. An asset value does not have a locale independent identifier. It is not possible to create facets or sort on assets Note: variant-level "assets" are not supported in search. Only set and list |
||
| ref | any primary universe product id | The Ref data type represents a reference from one item to one or more other items in a Relational Universe (link). This reference can be used to have an item inherit attributes from the items that are referring to it. This data type is used in Travel/leisure and B2B Retail installations to deal with different prices per holiday (Travel), or different prices per customer segment (B2B Retail). | |||
| datetime | any date after 1970-01-01T00:00:00Z | To represent date and time instants (Since FAS 21.3) | The date data type represents instances in time with millisecond precision. The values are read as ISO-8601 strings, and stored internally as milliseconds since 00:00:00 UTC on 1 January 1970. An offset from UTC can be specified as part of the date, and UTC will be assumed if it is not specified. Dates can be used for selection, sorting and facets. Please note, that the timezone of the date string is used only for parsing the date. A response date format can be specified in the Merchandising Studio for each universe/locale, as well as a timezone. That means, that you can parse the dates as ISO 8601 with UTC timezone, and display them with Sydney timezone with a custom format for example. This would be what's shown in the FAS response and in Preview Pages, not the input date string. Examples for ISO 8601 formatted dates are:
|
| For content rules and exact rules for identifiers please also see: Understand the Fredhopper data API |
| The basetype int does not support negative values. The basetype float does neither support negative values nor zero. |
The following table provides an overview of some of the Fredhopper functionalities and how each of the basetypes can be used for that:
| Type | Can select | Can sort | Can localize | Can search | Can have multiple values for the same item | Restrictions |
|---|---|---|---|---|---|---|
| int | 0 <= value < 2.147M | |||||
| float | 0 < value ... | |||||
| text | ||||||
| list | Theoretical at most 2.147M distinct values, in practice use no more than distinct 32765 values. | |||||
| list64 | at most 64 distinct values | |||||
| set | Theoretical at most 2.147M distinct values, in practice use no more than distinct 32765 values. | |||||
| set64 | at most 64 distinct values | |||||
| asset | ||||||
| hierarchical | only 'categories' allowed | |||||
| datetime | 1970-01-01T00:00:00Z <= value |
Fredhopper basetype examples
The table below lists some examples of the notation of each of the different available basetypes.
| Basetype | Example |
|---|---|
| int |
<attribute identifier="nr_of_reviews" type="int"> <value>2</value> </attribute> |
| float |
<attribute identifier="price" type="float"> <value>9.99</value> </attribute> |
| list |
<attribute identifier="country" type="list"> <value identifier="us" locale="en_US">United States</value> <value identifier="us" locale="fr_FR">Etats Unis</value> </attribute> |
| list64 |
<attribute identifier="instock" type="list64"> <value identifier="yes" locale="en_US">Yes</value> <value identifier="yes" locale="nl_NL">Ja</value> </attribute> |
| set |
<attribute identifier="color" type="set"> <value identifier="red" locale="en_US">Red</value> <value identifier="red" locale="fr_FR">Rouge</value> <value identifier="blue" locale="en_US">Blue</value> <value identifier="blue" locale="fr_FR">Bleu</value> </attribute> |
| set64 |
<attribute identifier="facilities" type="set64"> <value identifier="pool" locale="en_US">Pool</value> <value identifier="pool" locale="nl_NL">Zwembad</value> <value identifier="beach" locale="en_US">Close to the beach</value> <value identifier="beach" locale="nl_NL">Strand dichtbij</value> </attribute> |
| hierarchical |
<attribute identifier="categories" type="hierarchical"> <value identifier="catalog01" locale="en_US">Product catalogue</value> <value identifier="catalog01" locale="nl_NL">Product catalogus</value> <attribute identifier="categories" type="hierarchical"> <value identifier="cars" locale="en_US">Cars</value> <value identifier="cars" locale="nl_NL">Auto's</value> <attribute identifier="categories" type="hierarchical"> <value identifier="standardcars" locale="en_US">Standard cars</value> <value identifier="standardcars" locale="nl_NL">Standaard auto's</value> </attribute> </attribute> </attribute>
|
| text |
<attribute identifier="brand" type="text"> <value>Adidas</value> </attribute> |
| asset |
<attribute identifier="product_name" type="asset"> <value locale="en_US">Red T-shirt</value> <value locale="nl_NL">Rood T-shirt</value> </attribute> |
|
datetime |
<attribute identifier="release_date" type="datetime"> <value>2021-10-08T13:45:00Z</value> </attribute> |
Comments
0 comments
Article is closed for comments.