ais-query-rule-context
You are reading the documentation for Angular InstantSearch v3, which is in beta. You can find the v2 documentation here.
<ais-query-rule-context [trackedFilters]="object" // Optional parameters [transformRuleContexts]="function" ></ais-query-rule-context>
About this widget
The ais-query-rule-context
widget lets you apply ruleContexts
based on filters to trigger contextual Query Rules.
Query Rules offer a custom experience based on rule contexts. You might want to customize the users’ experience based on the filters of the search (e.g., they’re visiting the “Mobile” category, they selected the “Thriller” genre, etc.) This widget lets you map these filters with their associated rule contexts, so you can trigger contextual Query Rules upon refinement.
Examples
1
2
3
<ais-query-rule-context
[trackedFilters]="trackedFilters"
></ais-query-rule-context>
Properties
trackedFilters
|
type: object
Required
The filters to track to trigger rule contexts. Each filter is a function which name is the attribute you want to track. They receive their current refinements as arguments. You can either compute the filters you want to track based on those, or return static values. When the tracked values are refined, it toggles the associated rule contexts. The added rule contexts follow the format Values are escaped to only consist of alphanumeric characters, hyphens, and underscores. |
||
Copy
|
|||
transformRuleContexts
|
type: function
Optional
A function to apply to the rule contexts before sending them to Algolia. This is useful to rename rule contexts that follow a different naming convention. |
||
Copy
|