Skip to content

Commit 88ba929

Browse files
committed
improve description
1 parent 5f0cea8 commit 88ba929

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

specs/composition/common/params/Composition.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,13 @@ enableABTest:
116116
sortBy:
117117
type: string
118118
description: |
119-
Parameter targeting the `sortingStrategy` setting set in the Composition body.
119+
Indicates which sorting strategy to apply for the request.
120+
The value must match one of the labels defined in the "sortingStrategy" mapping. For example, "Price (asc)", see Upsert Composition.
121+
At runtime, this label is used to look up the corresponding index or replica configured in "sortingStrategy", and the query is executed using that index’s in the main injection.
122+
123+
In addition to "sortingStrategy", this parameter is also used to apply a matching Composition Rule that contains a condition defined to trigger on "sortBy", see Composition Rules.
124+
125+
If no value is provided, no sorting strategy is applied.
120126
default: ''
121127
example:
122-
"Price (asc)"
128+
'Price (asc)'

specs/composition/common/schemas/components/Composition.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,20 @@ composition:
1717
sortingStrategy:
1818
type: object
1919
description: |
20-
Sorting Label to indices. Up to 20 sorting strategies can be defined.
21-
example:
22-
{
23-
"Price (asc)": "products-low-to-high",
24-
"Price (desc)": "products-high-to-low",
25-
}
20+
A mapping of sorting labels to the indices (or replicas) that implement those sorting rules.
21+
22+
Each key is the label your frontend sends at runtime (for example, "Price (asc)"), and each value is the name of the index that should be queried when that label is selected.
23+
When a request includes a "sortBy" parameter, the platform looks up the corresponding index in this mapping and uses it to execute the query. The main injection targeted index is replaced
24+
with the sorting strategy index it is mapped to.
2625
26+
Up to 20 sorting strategies can be defined.
27+
maxItems: 20
28+
additionalProperties:
29+
type: string
30+
example:
31+
'Price (asc)': 'products-low-to-high'
32+
'Price (desc)': 'products-high-to-low'
33+
2734
required:
2835
- objectID
2936
- behavior

0 commit comments

Comments
 (0)