To support functionality for product variants (children), a JSON feed must be passed that conforms to the format described in this article. If you need assistance in formatting your JSON feed, contact your account owner to connect you to the appropriate Searchspring expert.
- Each Product object representation must exist in a new line of its own.
- One field, which must be named "children", may contain an array of objects, one for each variant.
- Any other top-level fields with multiple levels will be flattened, only accounting for the keys at the lowest level.
- A variant field containing an array of values will be considered to be all of those values at once. ie. a variant with color: ["red", "blue"] will be considered to be both red and blue simultaneously, not one or the other.
- Variant fields appear as one item on the Field Settings page
Feed Limitations
The following limitations are in place to protect the integrity and performance of Variant Search for your store.
Searchspring cannot override these limits under any circumstance. When formatting your JSON feed, ensure that these limits are respected. If a limit is exceeded, the feed will fail to process through the next product index.
- Every product can have up to 100 variants
- Every variant can have up to 50 fields
- Every variant has a maximum size of 200 kilobytes
Variant Rollup
In addition to indexing nested variants themselves, variant data will also be rolled up into a concatenated field on the parent product's level, matching the name of the variant's field.
It is critical that every variant has a unique name. That is, no variant and parent product can have the same name. If a parent field with the same name already exists, no rollup will occur.
- A product has the field "sku" set to "123"
- Each variant of the product also has a "sku" field, each with different values such as "123-1"
- The variant data will not be rolled up, keeping the original value of "123" on the parent product.
Example: Individual product in your data feed
This example has been expanded for readability. Your final feed should include one product per line.
{
"id": "11571537172",
"sku": "12345",
"title": "Summer Dress",
"url": "http://placekitten.com",
"image": "http://placekitten.com/g/200/300",
"collection_id": "450721620|3859242",
"price": "59.99",
"children": [
{
"size": "1",
"color": ["Red","Green"], // It's both red and green at once
"price_child": "59.99",
"sku_child": "12345-1"
}, {
"size": "1",
"color": "Red",
"price_child": "59.99",
"sku_child": "12345-2"
}, {
"size": "1",
"color": "Blue",
"price_child": "59.99",
"sku_child": "12345-3"
}, {
"size": "2",
"color": "Blue",
"price_child": "49.99",
"sku_child": "12345-4"
}
]
}
Example: Searchspring's indexed data
Here you can see how 4 new parent level fields were created after Searchspring indexes your data.
{
"id": "11571537172",
"sku": "12345",
"title": "Summer Dress",
"url": "http://placekitten.com",
"image": "http://placekitten.com/g/200/300",
"collection_id": "450721620|3859242",
"price": "59.99",
// Rolled up from children
"sku_child": "12345-1|12345-2|12345-3|12345-4",
"size": "1|2",
"color": "Red|Green|Blue",
"price_child": "49.99|59.99",
"children": [
{
"size": "1",
"color": ["Red","Green"], // It's both red and green at once
"price_child": "59.99",
"sku_child": "12345-1"
}, {
"size": "1",
"color": "Red",
"price_child": "59.99",
"sku_child": "12345-2"
}, {
"size": "1",
"color": "Blue",
"price_child": "59.99",
"sku_child": "12345-3"
}, {
"size": "2",
"color": "Blue",
"price_child": "49.99",
"sku_child": "12345-4"
}
]
}
Formatted Feed
Inform the owner of your Searchspring account once your feed is properly formatted. After this step, an internal review of your feed will be conducted before proceeding with the feature enablement process.
Comments
0 comments
Article is closed for comments.