Steps to implement Coveo Exlusion Filter

Last year when we were setting up Coveo search for a site an issue was brought to attention by my colleague @MadhuAkkireddy. The 404 and error pages are being indexed and we wanted to exclude them from index.

Below is the environment information

Environment:
1. Sitecore 8.1 update 3
2. Coveo for Sitecore 7 Free version.

 We performed below steps to remove the item from index
Add an exclusion filter

Exclusion filter added to Index

 If the items to exclude can be captured through a regular expression pattern, Coveo provides a feature to configure same

Using regular expression for exclusion filters


Unfortunately this did not solve the problem. we were still seeing the errors. We cleared the cache on website. But still not the expected result. Then after sometime we started to do deduct all the factors that can lead to this situation. Out of that we captured below steps to setup exclusion filter properly.

Steps

  1. In Coveo Admin panel, under content menu, Index browser, right click the item to exclude and click "Add an Exclusion Filter"
  2. Under Index Menu, Sources and Collections, ensure that item is appearing under Filters section
  3. To exclude more than 1 item that follows a pattern, you can use regular expression filters
  4.  Perform re-build index from Sitecore control panel

The Key to our issue was that we were performing indexing on Coveo and cache clear at Sitecore Sitecore end respectively. But what we were missing is to trigger a re-build index from Sitecore control panel. Once we did it, we solved the issue and were ready to face our next challenges.

Perform Re-index on Sitecore Control Panel


The same was mentioned in Coveo site as below
"If you have previously indexed items that are now excluded with your newly created processor, those items will be deleted from the index once you re-index them. If you want to completely remove all those undesired items from your index, you will have to trigger a rebuild from the Indexing Manager (in the Sitecore Desktop, access Control Panel > Indexing > Indexing Manager)." - Coveo
The reason for this blog is, at one point we went to a stage where we wanted to write custom pipelines for exclusion filters. However, we did a deduction brainstorming to avoid customization and ended up with above notes from Coveo on their site. Though the issue is very small in terms of fixing, it is very important to have overall understanding of the product you are working on. This will avoid customizing the original product for typical requirements. Saves you time and your clients investment.

You can do further reading on how to use pipelines for creating exclude filters in Coveo by follwing below URL.

https://developers.coveo.com/display/public/SitecoreV4/Excluding+Sitecore+Items+from+Your+Index
You can share situations like above in below comments. Will be looking forward to learn more from what situations you faced during your work. And also, I suggest you join the Sitecore slack channel where we have channels with great Sitecore developers discussing each and every aspect of Sitecore.

Comments