Query rules are an if-this-then-that framework for using rules to customize your search results. If a query meets all the criteria of a given query rule, the Search algorithm performs all the actions specified in the rule. This allows users to modify the search engines in a rules-based way. Each experience can have any number of query rules.
To learn more about query rules and example use cases, visit the Query Rules training unit. To view all possible criteria and action options, visit the Search Config - Query Rules reference doc.
To add Query Rules in the UI:
- Click Search in the navigation bar and click on the desired Search experience.
- Click Query Rules.
- Click Add Query Rule. A dialog box appears.
- Enter the name of your rule.
- Then click + Add Criteria and select the criteria option that will trigger this rule. Then enter the specific details in the textbox.
- Click + Add Actions and select the action you want to trigger with this Rule.
- Click Save Query Rule.
To add Query Rules in the JSON Editor:
- Click Edit as JSON in the navigation bar to open your Search Configuration file.
- Within the
"rules"
object enter the criteria needed to trigger the Query Rule and the desired action to be performed if the Query Rule criteria is met.
It should look something like this:
"rules":[
{
"criteria": {
"searchTermContains": [
"menu"
]
},
"actions": [
{
"actionType": "BOOST_ENTITIES",
"entityIds": [
"NEW-BURRITO"
],
"verticalKey": "menuItems"
}
]
}
Comments
0 comments
Article is closed for comments.