Filter and Boost Using the Rule Set Editor

Enterprise only

The Rule Set Editor lets you apply filtering at the search interface level or for a specific search interface tab. You can access the Rule Set Editor through the data source of the following Coveo for Sitecore renderings:

Although the Coveo Search Interface rendering view file automatically instantiates both a Query Filter and a Query Ranking rendering, you should insert standalone instances of these renderings in your search interface(s). This eases the configuration and reusability of these renderings.

Using the Query Filter Rendering

You can apply filtering expressions to all your search interface queries by inserting the Query Filter rendering and editing its data source.

  1. In the Experience Editor, locate and select the UI Header placeholder. When the UI Header placeholder is empty, the placeholder shaded area is visible (image below left). Otherwise, you can select a rendering that has been inserted in the UI Header placeholder and use the Go to the parent component option (image below right).

    UIHeaderPlaceholder UIHeaderPlaceholderViaGoToParent

  2. Click Add here.

  3. Select the Query Filter rendering.

    SelectQueryFilter
  4. Create a data source for your rendering.

    QueryFilterDataSourceCreation
  5. In the Query Filter rendering floating toolbar, select the Edit the rendering’s data source option. It should be the leftmost option on the floating toolbar.

  6. In the Query Filter section, just underneath Filter expression rules, click Edit rule.

  7. Click Add a new rule.

  8. In the Choose conditions section of the dialog, select the condition template you want to use (see Rule Set Editor Boosting and Filtering Rules Reference).

    FilterRuleTemplate
  9. In the Edit rule section, for each link in the condition template, click the link to either toggle between possible options or to set a value (e.g., clicking the where link will allow you to toggle between the where and except where options.)

    FilterRuleChangeValue
  10. If you want to add other conditions to your rule, repeat steps 7 to 9. You can change the and logical operator between the conditions, if need be.

    FinalFilterRule
  11. Give your rule a meaningful name.

    NameFilterRule

Once completed, the Query Filter rendering and its rule name should be displayed in the Experience Editor.

queryFilterAddedExperienceEditor

When executing queries in a search interface, you can review your call headers in the browser developer tools to ensure that the advanced query (aq) value properly reflects your query filter rule.

QueryFilterAdvancedQueryInDevTools

Using the Query Ranking Rendering

You can boost the score of targeted results on all your search interface queries by inserting the Query Ranking rendering and editing its data source.

  1. In the Experience Editor, locate and select the UI Header placeholder. When the UI Header placeholder is empty, the placeholder shaded area is visible (image below left). Otherwise, you can select a rendering that has been inserted in the UI Header placeholder and use the Go to the parent component option (image below right).

    UIHeaderPlaceholder UIHeaderPlaceholderViaGoToParent

  2. Click Add here.

  3. Select the Query Ranking rendering.

    SelectQueryRanking
  4. Create a data source for your rendering.

    QueryRankingDataSourceCreation
  5. In the Query Ranking rendering floating toolbar, select the Edit the rendering’s data source option. It should be the leftmost option on the floating toolbar.

  6. In the Query Ranking section, just underneath Boost expression rules, click Edit rule.

  7. In the Choose conditions section, select the condition template you want to use.

  8. In the Edit rule section, for each link in the condition template, click the link to either toggle between possible options or to set a value (e.g., clicking the where link will allow you to toggle between the where and except where options.)

    QueryRankingCondition
  9. If you want to add other conditions to your rule, click on Add a new rule and repeat steps 7 and 8. You can change the and logical operator between the conditions, if need be.

  10. In the Choose actions section, select whether you want to boost (add number to document score) the targeted items or reduce the score (remove number from document score) of the targeted items.

    BoostingRule
  11. In the Edit rule section, click the number link to specify the number of points to add to, or subtract from, the scores of the targeted items.

  12. Give your rule a meaningful name.

    BoostingRuleName

Once completed, the Query Ranking rendering and its rule name should be displayed in the Experience Editor.

QueryRankingInExperienceEditor

When executing queries in search interface, you can review your call headers in the browser developer tools to ensure that the advanced query (aq) value properly reflects your query ranking rule.

QueryRankingDevToolsQRE
What's Next for Me?