doc_attribute
Content: Attributes
List of attributes (for products and other entities)
Overview
In this Data Type, you can define all the properties and metadata of each of your attributes. Attributes can be used for products as well as other types of data (e.g.: Content) and bring additional information on how these data should be treated by the Boxalino platform.
All the properties you define in the string_attributes, localized_string_attributes, numeric_attributes, localized_numeric_attributes, datetime_attributes, and localized_datetime_attributes of the different data types should be defined here, so that Boxalino knows how to process them.
Example
In this example, we provide a simple attribute definition.
Standard Attributes
The following attributes are standard and should not be defined and their names should be avoided in your attributes (to avoid name clashes):
name | localized | format | multi value | mapping |
---|---|---|---|---|
selected_title | TRUE | string | FALSE | The title to display to the user in your front-end |
selected_image | TRUE | string | TRUE | The image to display to the user in your front-end |
selected_link | TRUE | string | TRUE | The link to the product page for your front-end |
selected_sales_price | FALSE | numeric | FALSE | The price after discount to display to the user in your front-end |
selected_list_price | FALSE | numeric | FALSE | The price before discount to display to the user in your front-end |
id | FALSE | string | FALSE | sku.internal_id |
title | TRUE | string | FALSE | sku.title* |
body | TRUE | string | FALSE | sku.description* |
scorerTerms | TRUE | string | FALSE | all searchable fields |
short_description | TRUE | string | FALSE | sku.short_description |
discountedPrice | FALSE | numeric | FALSE | sku.sales_price |
standardPrice | FALSE | numeric | FALSE | sku.list_price |
grossMargin | FALSE | numeric | FALSE | sku.gross_margin |
@random | FALSE | numeric | FALSE | - |
category_id | FALSE | string | TRUE | sku.categories |
product_line_internal_id | FALSE | string | FALSE | product_line.internal_id |
product_line_external_id | FALSE | string | FALSE | product_line.external_id |
products_group_id | FALSE | string | FALSE | product_group.internal_id |
product_group_external_id | FALSE | string | FALSE | product_group.external_id |
product_group_title | TRUE | string | FALSE | product_group.title** |
product_group_sales_price | FALSE | string | FALSE | product_group.sales_price |
product_group_list_price | FALSE | string | FALSE | product_group.list_price |
product_group_sales_price_distincts | FALSE | numeric | FALSE | number of different sales prices in the skus of the product group |
product_group_image_image | TRUE | string | TRUE | ‘image’ name of the product_group.images |
external_id | FALSE | string | TRUE | sku.external_id |
type | FALSE | string | TRUE | sku.type* |
ean | FALSE | string | TRUE | sku.ean |
sku | FALSE | string | TRUE | sku.sku |
is_new | TRUE | string | TRUE | sku.is_new* |
in_sales | TRUE | string | TRUE | sku.in_sales* |
brand | TRUE | string | TRUE | sku.brands* |
supplier | TRUE | string | TRUE | sku.suppliers* |
link | TRUE | string | TRUE | sku.links* |
image | TRUE | string | TRUE | sku.images* |
tag | TRUE | string | TRUE | sku.tags* |
label | TRUE | string | TRUE | sku.labels* |
stock | FALSE | numeric | FALSE | sum of all sku.stock |
stock_[NAME] | FALSE | numeric | FALSE | sku.stock |
visibility | TRUE | numeric | TRUE | sku.visibility* |
status | TRUE | numeric | TRUE | sku.status* |
product_group_status | TRUE | numeric | TRUE | product_group.status** |
creation | FALSE | string | FALSE | sku.creation |
pricing_type | FALSE | string | TRUE | sku.pricing.type |
visual_swatch | TRUE | string | TRUE | visual swatch object *** |
* if no sku value provided, will use product_group value and if no value either, will use product_line value
**if no product_group value will use product_line value
*** an object which provides the required information to do a visual swatch in the product listing (to let the user see, for example, the different color pictures of a product in the listing), it is structured as follows.
[
{
"name": "color",
"values": [
{
"value": "beige",
"value_id": "87",
"images": [
{
"name": "small_image",
"value": "media/catalog/product/5/3/5321612-balkonfacher-sicht-und-windschutz-balkonfacher-sicht-und-windschutz-beige-5321612-w.jpg"
}
],
"key": "beige",
"swatch": "/color/cp_0046.jpg"
}
]
}
]
Properties
Field name | Type | Mode | Description |
---|---|---|---|
name | STRING | REQUIRED | the name of the attribute (should match the name of the attribute provided in the doc_product table in either string_attributes, numeric_attributes or localized_numeric_attributes |
internal_id | STRING | NULLABLE | the internal identifier |
external_id | STRING | NULLABLE | the external identifier (can be the same as the internal identifier) |
label | REPEATED | the title of the attribute | |
attribute_group | REPEATED | the attribute group in which this attribute belongs | |
attribute_sub_group | REPEATED | the attribute sub-group in which this attribute belongs | |
stores | STRING | REPEATED | the stores |
format | STRING | REQUIRED | the type format of the attribute : 'numeric', 'string' or 'datetime', it is supported to set it to string but provide numeric attributes in the products, as lon as you have a mapping logic in the attribute values |
localized | BOOLEAN | REQUIRED | are the values localized (different for every language) or not, it is supported to set it to true but provide non-localized attributes in the products, as lon as you have a mapping logic in the attribute values |
link | REPEATED | the link of the attribute value | |
data_types | STRING | REPEATED | the list of related data types ('product', 'blog', 'content', ...), by default 'all' if empty |
multi_value | BOOLEAN | REQUIRED | is it possible for this attribute to have more than 1 value per sku (or final content), set to false unless necessary, as multi-valued vields cannot be sorted or grouped by |
hierarchical | BOOLEAN | REQUIRED | is it an attribute that has a hierarchy of values (e.g.: category tree) |
search_by | INTEGER | REQUIRED | should be indexed as part of the searcheable : 0 : values not indexed for search, 1 : values indexed for search only in main index, 2 : values indexed for search in specialized field which can be boosted individually |
search_suggestion | BOOLEAN | REQUIRED | should this attribute values be used as search suggestions |
filter_by | BOOLEAN | REQUIRED | is it an attribute that needs to be used as a filter in some requests |
group_by | BOOLEAN | REQUIRED | is it an attribute that needs to be grouped by in some requests (if set to true, then multi_value must be set to false) |
order_by | BOOLEAN | REQUIRED | is it an attribute that needs to be ordered by in some requests (if set to true, then multi_value must be set to false) |
indexed | BOOLEAN | REQUIRED | If true, the value of the field can be used in queries to retrieve matching documents. (true by default) |
visibility | REPEATED | the product visibility :VISIBILITY_NOT_VISIBLE = 1; VISIBILITY_IN_CATALOG = 2; VISIBILITY_IN_SEARCH = 3; VISIBILITY_BOTH = 4; | |
status | REPEATED | the product status | |
periods | REPEATED | information about the activity periods of the attribute | |
creation_tm | DATETIME | REQUIRED | technical field |
client_id | INTEGER | REQUIRED | technical field |
src_sys_id | INTEGER | REQUIRED | technical field |
Resources
BigQuery JSON Schema
https://github.com/boxalino/data-integration-doc-schema/blob/master/doc/doc_attribute.json
BigQuery DDL
https://github.com/boxalino/data-integration-doc-schema/blob/master/ddl/doc_attribute.sql