Migration: Wrapper Version 1.8.0
Introduction
This guide outlines the changes introduced in version 1.8.0.
Summary of Changes
| Endpoint | Change Type | Requires SPARQUE Changes | Description |
|---|---|---|---|
/facet-options /products /search | Improvement | Yes | Improved Mapping of Fixed and Dynamic Facet Options |
Improved Mapping of Fixed and Dynamic Facet Options
Affected Endpoints
- /api/v2/facet-options and newer
- /api/v2/products and newer
- /api/v2/search and newer
Changes
The Wrapper API response for fixed and dynamic facets has been enhanced to include additional attributes for individual facet options if such attributes are supplied by SPARQUE.AI.
Example for a fixed facet with additional attributes:
{
"id": "category",
"title": "Kategorie",
"rank": 1,
"options": [
{
"id": "Computers",
"score": 951.0,
"value": "Computer",
"attributes": [
{
"name": "description",
"value": {
"de-DE": "Der Produkt- und Servicekatalog für Computer.",
"en-US": "The Computers products and services catalog.",
"fr-FR": "Le catalogue des services et produits informatiques."
}
},
{
"name": "online",
"value": 1
},
{
"name": "root",
"value": 1
}
]
},
[...]
],
"attributes": [
[...]
]
}Example for a dynamic facet with additional attributes:
{
"id": "https://www.sparque.ai/ish/category/network-cables",
"identifier": "network-cables",
"score": 25.0,
"value": "Network Cables",
"localizedNames": {[...]},
"localizedValues": {[...]},
"childFacets": [],
"attributes": [
{
"name": "image",
"value": "M/28918-6725.jpg"
},
{
"name": "online",
"value": 1
},
{
"name": "root",
"value": 0
}
]
}As part of this update, the structure of the SPARQUE endpoints used by the Wrapper to retrieve fixed facet options has been updated.
Previous format:
[...]/options/{fixedFacetName}Adjusted format:
[...]/e/{fixedFacetName}/resultsRequired SPARQUE Changes
For dynamic facets, no modifications to SPARQUE are required. If the tuples returned by the facet_options or facet_options_lc endpoints include additional attributes, these attributes will automatically be available in the Wrapper response.
For fixed facets, however, changes to SPARQUE are necessary to support additional attributes. By default, the existing facet strategies and endpoints for fixed facets typically return only a string value, not an object. To enable the display of additional attributes for fixed facets, the SPARQUE endpoints must be updated to return objects containing the relevant fields. Additionally, the corresponding strategy needs to be adjusted accordingly. For details, refer to Defining Fixed Facets in a List or Search Result Page.
The updated mapping in the Wrapper is compatible with both the old and new formats, ensuring backwards compatibility.