Prepare Your Schema

Direct Feed Upload

Once you have your site key, you’re ready to upload your product catalog. A product catalog is a detailed list of products and their characteristics in a store.

This page walks you through the process of understanding what a schema and a catalog is, what and how you’ll need to upload both to seamlessly integrate them with our search solution.

  1. Prepare Schema
  2. Prepare Catalog
  3. Upload Feed

TIP: Customers using Magento 2, Shopify, and Hybris can use our platform plugin to upload their feed and integrate Analytics.

Prepare Schema

Your product catalog contains a list of all your products and their attributes. A schema defines the properties of the attributes in your product catalog.

For instance, when your catalog has fields like ‘title’, ‘size’, ‘price’, and ‘brand’, a schema file helps your search engine make sense of the information within such fields in the catalog. The schema establishes the properties of each attribute, determining the type of information the field will contain and display. A schema helps the search engine understand that ‘price’ is a numerical field and it should support range facets while ‘brand’ is a text field that should support text facets.

A schema is a key component of a product catalog that defines all fields used within your catalog. The type of operations supported on an attribute is directly driven by the schema defined for that attribute.

Schema Format

The schema is part of a larger JSON feed file and is defined by the “schema” node. Each JSON object within the schema represents a field within your catalog.

Each field must contain the following four properties:

Fieldname (mandatory)
datatype (mandatory) multiValue (Mandatory) isVariant (Optional) id (Optional) Autosuggest (Mandatory)

📘

NOTE

While we recommend you upload both the schema and catalog as a unified JSON file, you can also upload the schema as a separate file.

fieldName

The fieldName in the schema specifies the name of the attribute. Some examples of a fieldName are ‘productURL’, ‘sku’, ‘color’, ‘brand’ etc.

id

The id in schema specifies a numerical identifier for an attribute in the catalog. Useful when product feeds may have the fieldID instead of the fieldName.

dataType

A dataType defines the type of value a specific field can have.

The dataType attribute of a value (also known as a variable) is an attribute that tells what kind of data that value can have. Consider this analogy: A dataType is like a box that is designed to hold items only of specific characteristics.

We support the following nine dataTypes.

Data TypeFormatDescriptionSearchable
textStringUsed for fields that briefly describe a product such as title, occasion, color, brand, etc. Often used in search queries.yes
longTextStringUsed for fields that describe a product in detail such as description, seller_name, etc. Not typically used in search queries.yes
decimalDecimalUsed for fields that take decimal values such as price, discount, etc.
numberNumericUsed for fields that take numeric values such as quantity, orderCount, viewCount, etc.
linkURL (string)Used for fields that take URL strings as values such as productUrl, imageUrl, etc.
dateISO 8601 date format (YYYY-MM-DDTHH:MM:SSZ)Used for fields that take date values such as createdAt, updatedAt, etc.
booltrue/falseUsed for fields that take boolean values such as availability, hasBanner, etc.
skuStringUsed for fields that denote unique product information such as sku, uid (or pid), etc. Can be used in search queries.yes
pathStringUsed for hierarchical fields like categoryPath. Hierarchy values are separated by “>” (e.g., “Men>Shoes>Casual Shoes”).
facetStringUsed to filter products on Product Listing Pages. Not processed for spelling, stemming, or tokenization.
nskuStringUsed for unique product info like skuid. Supports partial search. Can be used in search queries.yes
📘

NOTE

Data Types of fields that are made searchable display those products on the search results page. Data Types that are not searchable can be used for filtering, sorting, and faceting.

autoSuggest

The autoSuggest attribute specifies if the value of the field will appear as a suggestion within the autosuggest widget.

multiValue

A multiValue attribute determines if a field can take multiple values. For example, when a shirt with one productID has two or more images (front/back) of the same shirt, then ‘image’ is a multiValue attribute.

To enable a field to accept multiple values, set multiValue to true. Else, false.For instance, in the screenshot below, a laptop may have multiple images for the same product (SKU) and this is called a multiValue attribute.Note: A multiValue attribute describes multiple attributes (different images etc) for a field of the same product/sku, while a variant describes different products with varying attributes (size/color/material) which can be grouped together. Both of these attributes help your shopper make an informed purchase decision.

isVariant

Variants define different attribute values of the same product. For example, a dress can have different colors: red, green, blue. Such different values of the same attribute has the same productID and variantID. The laptop in the above example is also available in two different colors and hard disk capacities. This is called a variant attribute. Each laptop in the variants listed have different SKUs but are grouped together to help your shoppers view all the product options available.

If, isVariant=true, then the product will have variants. If there are no variants, set isVariant is set to false.

Sample Schema

{
"feed": {
        "catalog": {
            "schema": [{
                "fieldName": "vColor",
                "id": "76678",
                "dataType": "text",
                "multiValue": "true",
                "autoSuggest": "false",
                "isVariant": "true"
            }, {
                "fieldName": "vSize",
                "dataType": "text",
                "multiValue": "true",
                "autoSuggest": "false",
                "isVariant": "true"
            }, {
                "fieldName": "vImages",
                "dataType": "link",
                "multiValue": "true",
                "autoSuggest": "false",
                "isVariant": "true"
            },
{
                "fieldName": "vPrice",
                "dataType": "decimal",
                "multiValue": "true",
                "autoSuggest": "false",
                "isVariant": "true"
            }]
        }
    }
}