Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

This article highlights and explains how to set up conditionals and combine features to build powerful, precise rules. 

What are conditionals? And why should I use them? 

A conditional statement (also called an If-Then Statement) is a statement with a hypothesis followed by a conclusion. Another way to define a conditional statement is to say, “If this happens, then that will happen.”

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.


Example Conditionals

Examples of conditionals you can use in Hawksearch would be the following:  

  • If an item is on sale, then boost it relative to the top of other relevant search results. 
  • If an item is discontinued, then hide it. 
  • If an item is cheaper than other items in the search results, then bury it to the bottom of the results. 
  • If an item is a very popular item in the department, then pin it to the top of the search results for the department name.  

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. 

 

Instructions

From the basic rule box, you are able to set a conditional trigger using a logical conditional statement. When this statement is true then a defined rule or action will occur. 

ANY vs. ALL

The ANY/ALL operation selects whether any condition makes the whole statement true, or if all conditions must be true for the whole statement to be true.  This is easiest to explain using examples: 



This statement is true if the an item is a Columbia Sportswear branded item. 

This statement is true if the an item is a Columbia Sportswear branded item OR colored Red. 

For this statement anything that satisfies either condition, Columbia brand or Red colored returns true for the whole statement.

Similarly, the following statement returns true for all Columbia, Salomon, and North Face products. Since any product in either of the three brands returns a true statement. 


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: 

Single condition

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.


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.  


  1. Contains
  2. Does Not Contain
  3. Contains In
  4. Does Not Contain In 
  5. Is 
  6. Is Not
  7. Is In 
  8. Is Not In


Contains

This is the operator to use when you want to target part of a field or keyword. For example, if you want to show a banner to anyone who searches for a Nike branded item in the search bar, even if they specify a type of clothing or attire after it, you could use the following statement. Searches for "Nike", "Nike shoes", "Nike pants", "Nike bag", "Nike ball", and "Nike football gear"  would all return true for the following conditional.    

Does Not Contain

This is the operator to use when you want to target part of a field or keyword, while excluding a subset of the results. For example, if you want to show a banner for a hammock sale to anyone who searches for camping in the search bar, while excluding anyone who searches for tents you may set up the following trigger. 

Contains In

Use Contains In when you want to search for any one of several terms to make the conditional true. Think of this as an OR statement. The following example will return true if someone inputs any of the following words into the search bar as a keyword or part of a keyword: camping, hiking, adventure, and sleeping bags.  

Does Not Contain In





Instructions







  • No labels