Back to Website
Product Documentation Commerce Search Explore Search Category Search Rules

Operations Search - Category Search Rules

Category Search Rule

Category Search Rules are only applied when a customer goes to a category screen. These rules are not applied when a user does a search in the search box. Normally, this type of rule is used to change the scoring and sorting of the products on the screen.

Setting up the Rule

Define this rule by making Query = * and Rule Type = blank. The system currently does not support searching within a category, so the query must always be *. Normal boosting and sorting can be set up. If using boosting, it is important to set up the customSort rule to sort by score first which is not the default in the system. All product scores = 1 unless you are trying to boost products. Once boosting is applied, those products will have a higher score. See the example below of how to then apply the score to the sort rather than the default system productOrder on category pages.

Above, we set up a category rule where:

  • Boost the product code aempf14 by a factor of 10
  • Boost any product within the brand Purdy by a factor of 5
  • Change the default system sort (productOrder) to use score on a product page
  • If the score is the same (usually 1 because there is no search), then sort by productOrder

Assigning the Rule to Categories

Once you have the rule set up, you can assign as many categories to it as you like by clicking the arrow next to the rule.

The Results

Go to a category screen assigned to the rule on the customer side and review the results.

Special Considerations

  • Each category must be assigned, category rules are not inherited down the category tree.
  • Rule order is important. The engine will choose the first category rule assigned to the category based on the rule order.
  • By default, category pages sort by productOrder as products have no “score” since we are not searching for a search term. Scores will show up if boosting queries are used.
  • If using boosting queries to boost products, make sure to use the customSort to sort by score first and then productOrder or any other fields you want to sort by.
  • If the user chooses a way to order the products, the customSort will not be used.
In this article