Appearance
Category Scopes
Certain features of Relewise, such as faceting, filters, merchandising, and the Similar Products recommendation rule, make use of category scopes to determine how the category paths of entities should be evaluated for the specific request.
Relewise operates with three levels of category scope: Ancestor
, ImmediateParent
, and ImmediateParentOrItsParent
. This scope is defined on the basis of the entity or entities being affected by the request. It is important to understand that Relewise does not create a hierarchical "tree structure" of the category data imported to our dataset; instead, Relewise processes all Category paths across entities and treats them as "equal".
This means that it is possible within Relewise to have "recursive" category paths, where - across entities - category A is subordinate to category B, and category B is subordinate to category A. While this might not be particularly useful from a commercial standpoint - and can indeed cause confusion - Relewise does nothing to prevent this from happening. As always, we encourage data sanitization so you avoid needlessly complex and unworkable solutions.
To explain the different category scopes, we will use an example of the following category paths existing across product entities. Note that one product can contain multiple category paths. For this example, we assume that the category paths are spread out across multiple products.
Category Paths:
A -> B -> C
A -> D -> C
A -> E -> B
B -> Q -> Z
Ancestor
Ancestor
looks for any category path wherein the specified Category ID is contained somewhere in the path.
For the above example, a ProductCategoryID filtering on category ID b
with CategoryScope = Ancestor
would match on products that contain category paths 1, 3 and 4.
ImmediateParent
ImmediateParent
looks for any category path wherein the specified Category ID is contained in the final position of the path.
For the above example, a ProductCategoryID filtering on category ID b
with CategoryScope = ImmediateParent
would match on products that contain category path 3.
ImmediateParentOrItsParent
ImmediateParentOrItsParent
looks for any category path wherein the specified Category ID is contained in the final position, or the second-to-last position of the path.
For the above example, a ProductCategoryID filtering on category ID b
with CategoryScope = ImmediateParentOrItsParent
would match on products that contain category path 1 and 3.
Visual Example of Category Scopes
Ancestor
matches on 1, 3 and 4 because the specified category ID, b
, exists somewhere in those paths.
ImmediateParent
matches on 3 because category ID b
exists at the last node in that path.
ImmediateParentOrItsParent
matches on 1 and 3 because category ID b
exists in the last or second to last node of those paths.