This article highlights and explains how to set up conditionals and combine features to build powerful, precise rules.
...
The antecedent is the first, or “if,” part of a conditional statement. The consequent is the second, or “then,” part of a conditional statement. The consequent is the result of the antecedent. Keep in mind that conditional statements might not always be written in the “if-then” form. Conditional statements may be nested such that either or both of the antecedent or the consequent may themselves be conditional or logical statements.
Info |
---|
Examples of conditionals you can use in Hawksearch would be the following:
|
By using well-formed conditionals in Hawksearch to trigger actions, you can precisely enable actions like boost/bury, visibility rules, landing pages, item pinning, etc.
Table of Contents maxLevel 3
Navigation
Conditional statements are found in Hawksearch to program and select pools of items or content based on certain conditions. The image above highlights the basic features of a conditional trigger.
- ANY/ALL Selector Box
- Field Selection Dropdown Box
- Operator Selection Dropdown Box
- Value Input Field (Autocomplete Enabled)
- Add Condition Box
- Depth Adding Box
- Angled Bracket >> Adds a nested condition one layer below the selected condition.
- Minus: Clicking on this deletes the selected condition.
...
If you now switch the ANY to ALL, you realize that there is no product that satisfies the conditional. The only product that would make this statement true, must be branded as Columbia, Salomon, and The North Face at the same time.
To trigger an action for all Columbia branded items that were colored red, you would set up the following conditional:
Info | ||
---|---|---|
| ||
If a statement only has one condition, it doesn't matter if you use ANY or ALL since they are logically equivalent. |
Field Selection
You may select any field that is set toXXXXX.variable from the drop down box to be the field used to trigger an action.
Operators
Conditional statements in Hawksearch utilize several operators to logically evaluate statements. All operators are not applicable to each field, depending on if the operator is derived from data or from user inputs.
...
Info |
---|
Not all fields are capable of using all operators! Strings XXXXXXXXX CHECKSome fields are set as text strings, some as numbers, etc. The settings of a field determine what operators can be used. Also, if you're using a field condition that is explicitly in the data, your entry must be a perfect fit. For example, department name, color, or any other field. |
For numerical fields, the operators perform mathematical comparisons.
...
The Is in operator is for any one a series of possible exact matches. Think of Is In as IS with an OR in between each term. For example,
This is logically equivalent to this case with the ANY condition setting enabled:
Here's a case where using is in makes a logical condition much easier to understand and implement.
...