Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.


Info
titleExample 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. 

...

Info
titleSingle 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


Info

Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@21fba2
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ( "conditional" , "in" , "contains" , "trigger" , "is" ) and type = "page" and space = "HSKB"
labelsconditional trigger is in contains

...

Page Properties
hiddentrue


Related issues