Prepare your feed
In order to have a good search experience that retrieves and displays all your products, you need to index your catalog in the search engine. In order to transfer your catalog information to Empathy Platform, you must create a feed, that's a structured inventory of your catalog based on your already designed data model.
The Index microservice must be able to recognize the feed's format and content to process your data. Regarding format, the Index microservice requires files preferably in JSON format. XML or CSV formats are also accepted; however, compressed collections are not supported.
Tip
When you create the feed file, you translate your catalog data into a specific format—JSON, XML, or CSV. To do so, you first need to gather your product data. Regardless of your source data format, you can run a script to fetch the information, map it into the desired format, and use the resulting file as a base to work on your feed file.
In terms of content, the file you need to create is a flat collection of documents, where each document contains all the fields necessary to describe an product, such as title, description, stock, color, among many others.
In case your commerce store is available in more than one language, you create as many feeds as supported languages. As a result, you must index one feed file per language. The feed file supports over 40 languages. For further inquiries about the supported languages, contact your Key Account Manager.
To get started with your feed, follow these guidelines:
- Planning your search and discovery experiences
- Building the architecture of your product catalog
- Understanding the feed fields
- Describing your products
- Providing images for your products
Planning your search and discovery experiences
Before you start composing your feed file, you must have explored your catalog's data model. The data model maps the fields supported by the feed file and how they serve Empathy Platform's features and tools. Based on the search and discovery experiences you want to provide to shoppers communicating with your commerce store, use the data model as a guideline to define your feed file's content.
interact
Explore the Empathy Platform features to make the most of your search and discovery experiences!
Building the architecture of your product catalog
The first step for creating a feed file is defining the architecture of your catalog data. The feed file supports several fields that you can use to organize your products in categories and, consequently, structure categories into hierarchies.
By developing categories, you not only structure your catalog but also define the way shoppers communicate with it during the search and discovery experience. Note that categories are used for search and navigation as facets, or rather criteria suggested by the search engine for shoppers to further filter the query results. Read more about feed supported fields when defining categories.
In addition, supported fields help you organize your products' information in a way that their attributes are readable and undestandable for the Search engine and leveraged by the Empathy Platform features and tools.
Feed file example: Architecture of a feed file
Here's an example of a valid architecture of a JSON feed file. The hierarchical organization of JSON documents (being a document each product of your catalog) is highly customizable as it varies based on your commerce store needs.
{
"products": [
{
"id": "unique_string_12345",
"externalId": "any external reference",
"name": "name of the product",
"description": "description of the product",
"shortDescription": "short description of the product",
"categories": [
{
"id": "id12345",
"name": "Root Category Name",
"children": [
{
"id": "id12345",
"name": "Parent Name"
}
]
}
],
"type": "product",
"images": [
"http://your.domain/image-12345.jpeg"
],
"url": "http://your.domain/product",
"price": {
"currency": "EUR",
"current": {
"value": 11
},
"previous": {
"value": 5.54
},
"future": {
"value": 12.0
}
},
"stock": 8,
"colours": [
{
"name": "Light Blue",
"id": "121499"
}
],
"sizes": [
"EU 44"
],
"dimensions": {
"width": "125cm",
"heigth": "34cm",
"depth": "25cm"
},
"brand": "Product Brand Name",
"collection": "summer-2022",
"tags": [
{
"name": "ring",
"icon": "http://your.domain/ring.png"
}
],
"stores": [
"Store-0",
"Store-1"
]
}
]
}
Understanding the feed fields
For the feed file to be valid for indexing, it has to follow a specific structure. The feed file supports two types of fields, required and optional, where:
- The required fields define product categories and identify products.
- The optional fields provide commerce store information about the products.
interact
Check the complete list of supported fields to start translating your catalog into an indexable feed.
Describing your products
Once the feed file architecture is ready, you translate your products into documents. Each product can be unique or can exist in more variants, for example a t-shirt of a commerce store existing in more sizes and prices. In the feed file, each product variant corresponds to a separate document referring to the product and containing a different set of properties.
note
You must have determined the scheme of fields to be mapped and included in your feed file previously. Refer to the data model page for more insights.
When you define the fields' properties and values, you also design which product information is retrieved by the search engine to be shown to shoppers and how to display it during the search and discovery experiences. To define your feed fields, also called documents, you need to follow the indications in the list of feed supported fields. Custom fields are supported. At this moment, you lay the groundwork for using search features such as Query Suggestions, Next Queries, Recommendations, etc. by defining parent-child relationships between the documents.
Providing images for your products
Every good catalog not only provides the items' description but also a nice image illustrating the item. In the feed file, you can add images for your items with the images field to offer joyful, understandable search and discovery experiences to people. The images field only supports URLs, so you need to ensure the chosen images are available for browsing at all times. For your images to perform right in your business:
- Try to use absolute URLs.
- Choose valid web formats, preferably, JPG or WEBP.
- Optimize the image size as compressed for web.