THIS IS ARCHIVED DOCUMENTATION

Creating Custom Filtering Rule Conditions in Sitecore Using the Coveo for Sitecore Legacy Search UI Framework

Enterprise only Coveo for Sitecore 4.1 (November 2018)

Coveo for Sitecore already offers a variety of rules for you to use in your Coveo components (for a complete list of all rules available out of the box, see Rule Set Editor Boosting and Filtering Rules Reference). However, you may want to programmatically add a rule to the Ranking Editor UI, allowing an end user to express complex conditions to filter search results or manage relevance with boosting rules without having to write code.

The Sitecore Search Provider framework allows a query to be performed on a search index without having to know search engine-specific language. In the C# code, the query is expressed using the LINQ language; the Search Provider then translates it into an expression that the search engine understands.

This tutorial will show you how to create a rule that filters or boosts items part of the current website, which can prove useful in a multi-site installation.

While there already exists a rule that allow you to filter or boost an item and its subitem, this rule dynamically adapts to the current site, and can therefore be easily duplicated and moved to other sites.

Requirements

For this tutorial, you need:

  • A Sitecore instance.
  • Coveo for Sitecore installed on your Sitecore instance.
  • A Coveo for Sitecore Enterprise edition license to have access to the Rule Set Editor.

Here are the steps to follow to create your custom rule:

  • Creating a Custom Rule Condition for Coveo for Sitecore
  • Integrating the Custom Rule Condition in Sitecore