Process Schema
Use this document for internal purpose only. It is not suppose to be shared with customers
After we have created processed json, before we can index it into the Unbxd system, we need to create its schema. Schema is the meta data of each attribute in the processed json.
Meta data of fields
- dataType - Data type of a field. It could be
text
,decimal
,number
,skus
. The complete list of dataType could be found below - multiValue - multiValue could either be
true
orfalse
. If a attribute contains a list of value then itsmultiValue
should betrue
otherwisefalse
- autoSuggest - autoSuggest could either be
true
orfalse
. If a attribute should be the part of autosuggest then its value should betrue
otherwisefalse
- fieldName - fieldName contains the name of the feed attribute.
Sample Schema looks like this
{
"feed": {
"catalog": {
"schema": [{
"dataType": "sku",
"fieldName": "sku",
"autoSuggest": "false",
"multiValue": "false"
}, {
"dataType": "text",
"fieldName": "title",
"autoSuggest": "false",
"multiValue": "false"
}, {
"dataType": "link",
"fieldName": "productUrl",
"autoSuggest": "false",
"multiValue": "false"
}, {
"dataType": "text",
"fieldName": "uniqueId",
"autoSuggest": "false",
"multiValue": "false"
}, {
"dataType": "link",
"fieldName": "imageUrl",
"autoSuggest": "false",
"multiValue": "true"
}, {
"dataType": "number",
"fieldName": "stockWa",
"autoSuggest": "false",
"multiValue": "false"
}, {
"dataType": "path",
"fieldName": "categoryPath",
"autoSuggest": "false",
"multiValue": "true"
}, {
"dataType": "decimal",
"fieldName": "price",
"autoSuggest": "false",
"multiValue": "false"
}]
}
}
}
Schema Processing Stages
Metadata Mapping
Metadata Mapping
is a table in which you maps each attribute in the processed json to its meta data information. Metadata Mapping
table looks like this
Field Name | Data Type | Multi Value | Auto Suggest |
---|---|---|---|
sku | sku | false | false |
title | text | false | true |
productUrl | link | false | false |
uniqueId | text | false | false |
imageUrl | link | true | false |
categoryPath | path | true | false |
price | decimal | false | false |
inventory | number | false | false |
other_field | text | false | false |
Once we have metadata mapping
, we need to create the process it in the inform it can be ingested in the Unbxd system.
Processing Script
Having Metadata Mapping
in hand, we can start with developing schema processing script which will have primary two functions
- Using the meta information present in the
metadata mapping
, create the processed schema which can be ingested into the Unbxd system. - If any attributes whose meta information is not defined, default information would be
datatype:text, multiValue:false, autoSuggest:false
Flow of Processing script
- Loop through each attribute present in the
metadata mapping
. - For each attribute, create json based on key and its corresponding value.
- Finally push products in the global
list_of_attributes
<< Summary Video on how to create schema >>
Once we have processed feed and schema, we are ready to index the feed and schema.
Did you find it useful? Rate it