Optional
allApplies logical AND to nested rule match clauses. Matches if all of them match
Optional
anyApplies logical OR to nested rule match clauses. Matches if any of them match
Optional
everythingIf set to true
, rule will always match. Skip this parameter if it's not needed, does not accept false
value. Used to create global rules in dashboard
Optional
functionExpected values to be compared against. Rule matches if at least one of them matches
Optional
notApplies logical NOT to rule match clause. Matches if nested clause does not match
Optional
paramParam from search query from where the value will be extracted
Optional
valueExpected values to be compared against. Rule matches if at least one of them matches
Rule match specifies when the rule will be applied. Parameters groups are sent based on match type that you are using. Only send parameters which belong to the filter type you are using.
Everything match - matches every time. Used for global rules that should be applied on every request Example:
Param match - extracts value from specified search request param and compares it to expected value. If param value matches expected value, the rule is applied. Values are preprocessed before comparing them (lowercased, phrases split into tokens, etc.). Both input values and expected values are preprocessed using the same logic before comparison. At least one item from expected value array must match for the rule to match as a whole.
Example - apply rule when user searches for
battery
In this case, no function was used, so values were processed minimally and exact match was applied. You can change this behavior using one of available functions
Param Stem match - used when you want to use exact match but you want to match different variations of the word. In the previous example, rule would match with search query
battery
, but will not withbatteries
. To solve his, provide stem match function:Param Contains match - used if you care about terms appearing in search query but don't care about order. Values are processed in the same way as if no function was provided. Matching is done using contains match. If you have a rule:
It will match with search query
battery
,A4 battery
,Li-ion battery
, etc.Param Stemmed Contains match - values are stemmed and applies a contains match. With rule:
You will be able to match
battery
,batteries
,batteries for sale
,strong battery
, etc.Last type of match is logical match. It works the same way as
InputSearchFilter
logical match does.Logical AND - Used when multiple conditions need to be met for rule to match Example:
Logical AND - Used when one of the conditions need to be met for rule to match: Example:
Exclude match - Used when you want to negate a match condition Example: