Migration: Wrapper Version 1.3.0
Introduction
This guide outlines the changes introduced in version 1.3.0.
Summary of Changes
Endpoint | Change Type | Requires SPARQUE Changes | Description |
---|---|---|---|
/search /products /facet-options | New feature | Yes | Localized facet filtering |
/search /products /facet-options | New feature | Yes | Channel-specific fixed facets |
/categorytree | Bug fix | No | Category tree filtering and caching |
Localized Facet Filtering
Affected Endpoints
- /api/v2/search
- /api/v2/products
- /api/v2/facet-options
Changes
Version 1.3.0 of the Wrapper can use the new SPARQUE API endpoint facet_options_lc, which returns the facet's options for the selected locale only. Additional configuration is required to use this endpoint.
Required SPARQUE Changes
The new stacked endpoint OBJ -> facet_options_lc/p/locale/{string}/p/attribute/{string} -> OBJ,DOUBLE
must exist in the workspace. The logic to filter the facet options must be implemented in the strategy. There is no filtering added to the Wrapper itself.
Output example:
{
"offset": 0,
"count": 3,
"type": [
"OBJ",
"DOUBLE"
],
"items": [
{
"rank": 1,
"probability": 342,
"tuple": [
{
"id": "https://www.sparque.ai/ish/propertyvalue/Color_of_product/Black_enUS",
"attributes": {
"id": "Black",
"name": "Color_of_product",
"value": {"en-US": "Black"}
}
},
342
]
}, [...]
]
}
Configuration
The Wrapper setting Localized Facet Filtering must be enabled for this endpoint to be used. This can be done in SPARQUE Hub.
Channel-Specific Fixed Facets
Affected Endpoints
- /api/v2/search
- /api/v2/products
- /api/v2/facet-options
Changes
Starting with version 1.3.0, calls from the Wrapper to the SPARQUE endpoint /e/fixedFacets include the additional context parameter channel
.
Required SPARQUE Changes
You can use the new parameter by providing the SPARQUE endpoint and incorporating the parameter into the corresponding strategy:
fixedFacets/p/channel/{STRING} -> OBJ
Category Tree Filtering and Caching
Affected Endpoints
- /api/v2/categorytree
Changes
This release introduces several improvements and bug fixes related to the categorytree endpoint:
- Resolved an issue where category trees with more than 10,000 nodes resulted in incomplete or empty responses. The Wrapper was updated to handle category trees with up to 100,000 nodes.
- Fixed a caching issue where providing an
EntryCategoryId
could return cached results from requests made without or with a differentEntryCategoryId
. With release 1.3.0, the Wrapper now correctly considers theEntryCategoryId
when storing and retrieving data from the cache. - Fixed an issue where the
Levels
parameter was ignored when anEntryCategoryId
was provided, resulting in the full subtree being returned. Starting with version 1.3.0, the response now respects both parameters as provided.