In the versions of FAS prior to 8.0, rule-based entities (campaigns, facets, rankings, redirects, and result modifications) were grouped by a universe and a locale. Each entity had its own rank (position) within its universe/locale. A request to the query API is bound to a universe/locale as well. So the order the entities were showing up in the Merchandising Studio (MS) or in the Preview Pages (which also implies the FAS response) was straightforward.
Since FAS 8.0 triggered entities are placed into the arbitrary scope structure, which does not necessarily follow the universe/locale pattern. Both MS and the FAS response can contain, say, facets from different scopes. But what is their order? This page explains the logic FAS applies to sort rule-based entities.
Sorting by scopes in the Business Manager
Starting from FAS 8, all rule-based entities belong to scopes. A scope, in turn, belongs to a parent scope (until the root one).
Imagine, there is a webshop that sells fruits. It is UK-based but also works for other counties. Especially for the UK, it promotes organic products. So, it has one universe (catalog01), two locales (en_GB and en_ZZ) and the structure of the following scope:
scopes |--- Shop <- Has a universe trigger for catalog01 |--- UK <- Has a locale trigger for en_GB | |--- Organic products <- Has a keyword trigger for 'organic' |--- Other countries <- Has a locale trigger for en_ZZ
There are different business rules set up across the scopes. In the Merchandising Studio, rule-based entities are sorted by their scope by default. The sorting is based on three criteria (from the most important to the least important one):
- The level of a parent scope.
- The order of a parent scope within its parent.
- The order of an entity inside its parent scope.
For example, consider the facet management page for the Fruit shop:
There are five facets configured. The Categories and Country ones will be displayed for every lister/search page. The Price facet will be shown every time as well, but it is set up slightly different for the UK and for the other regions. So, there are two copies in the respective scopes. Finally the 'Is 100% organic' facet is only important for organic products, therefore is placed in the 'Organic products' scope.
It can be seen that:
- The facets from the top-level scope (Shop) are placed first.
- Then it goes the facet which belongs to the first child of Shop (UK).
- Then it goes the facet which belongs to the first child of UK (Organic products).
- Then it goes the facet which belongs to the second child of the Shop (Other countries).
The same principles apply to every entity type (Campaigns, Rankings, Result Modifications, Redirects, Synonyms).
Sorting in a FAS response
Sorting in a FAS response works differently for Facets and for the other types of entities. The reason is importance: FAS assumes that more important facets are defined in more global scopes, while more important rankings, campaigns, and result modifications are defined in more concrete scopes.
Let's consider the entity types one by one.
Facets
Generally, the order of facets in a FAS response corresponds to the one in the MS: it is more important to show generic facets (the ones which belong to a higher scope) first. The following picture shows the facets triggered for a response (please compare it to the image from the previous chapter):
The facets from the highest scope are shown first, according to their order in the scope. Then the facet from the Shop's child (UK), then the facet from its child (Organic products). The facet from the 'Other countries' scope was not triggered.
Campaigns
Similarly to facets, there are five campaigns set up. Their sorting logic inside the MS is absolutely the same: campaigns from higher scopes are placed higher:
There is a global advertisement, visible everywhere. We also decided to suggest bananas to every visitor. There is a specific ad, visible for visitors to the UK shop, and the specific ad for organic products.
However, from a business perspective campaigns which belong to the lower scopes are more 'relevant', so will be placed in the FAS response first:
As it can be seen, when a user looks for organic products, a respective campaign gets shown first, then the campaign for the UK shop, and finally two global campaigns (here the order in their scope is respected, so the 'Global ad' takes precedence).
Rankings
Rankings follow the 'most specific wins' rule as well as campaigns. In the next picture there are 4 rankings defined:
- A global one will order items by the match rate.
- Two rankings from the Shop/UK scope would order items by their origin and price respectively.
- The ranking from the Organic products scope ensures that 100% products get displayed first .
In this setup, the 'By origin' ranking will be triggered by default, because:
- It is more specific than the global one.
- It is defined first in its scope (Shop/UK).
If a user requests a location that matches the 'Organic products' scope, the 'Organic first' ranking will be applied because it becomes the most specific in this case.
Note: that only one ranking (the one which triggers and 'wins') gets applied.
Result modifications
Result modifications follow the same principles as campaigns: a result modification triggered for a more specific scope takes precedence. In the following image, three modifications are defined: two of them are in the global scope Shop, the last one is valid for the UK customers.
In the response we can see that:
- The organic product banana comes first, so the most specific modification takes precedence.
- Then comes red apple because of the first modification from the least specific scope.
- Then comes the green apple because of the second modification from the least specific scope.
Redirects
Redirect follow the same 'the most specific one wins' policy as campaigns, redirects and result modifications. So, the first redirect, defined in the most specific scope will trigger.
Synonyms
In the Merchandising Studio, the synonyms will be shown according to their scopes. There is no way to change their order inside a parent scope.
Note: It only makes sense to put synonyms in scopes that have both universe and locale triggers. Otherwise, the synonyms would not be activated.
Synonyms do not appear in the FAS response, therefore their ordering is not applicable there.
Changing the order of entities
Knowing the sorting rules, it is apparent how to change the order of the entities in the FAS response:
- Entities can be placed in another scope.
- Scopes can be re-ordered within their parent scope.
- Entities can be re-ordered within a scope.
The two first methods should be applied with a lot of care because they can have a high impact on the whole system! So, the last method is the one that should be used by default.
Comments
0 comments
Please sign in to leave a comment.