Skip to content

Commit 2c4c12c

Browse files
algolia-botClaraMullerFluf22
committed
feat(specs): add sortBy trigger on Composition Rules (generated)
algolia/api-clients-automation#5707 Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com> Co-authored-by: Clara Muller <5667350+ClaraMuller@users.noreply.github.com> Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
1 parent ba32e99 commit 2c4c12c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

algoliasearch/composition/models/condition.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"anchoring": "anchoring",
2727
"context": "context",
2828
"filters": "filters",
29+
"sort_by": "sortBy",
2930
}
3031

3132

@@ -45,6 +46,8 @@ class Condition(BaseModel):
4546
""" An additional restriction that only triggers the rule, when the search has the same value as `ruleContexts` parameter. For example, if `context: mobile`, the rule is only triggered when the search request has a matching `ruleContexts: mobile`. A rule context must only contain alphanumeric characters. """
4647
filters: Optional[str] = None
4748
""" Filters that trigger the rule. You can add add filters using the syntax `facet:value` so that the rule is triggered, when the specific filter is selected. You can use `filters` on its own or combine it with the `pattern` parameter. """
49+
sort_by: Optional[str] = None
50+
""" Sort criteria that trigger the rule. You can trigger composition rules based on the selected sorting strategy set by the parameter `sortBy`. The rule will trigger if the value passed to `sortBy` matches the one defined in the condition. """
4851

4952
@field_validator("context")
5053
def context_validate_regular_expression(cls, value):

0 commit comments

Comments
 (0)