Skip to main content

Posts

Showing posts from October, 2016

Create custom Sitecore Search Crawler

Hello, I would like to show an implementation of a custom crawler which prevents indexing items under specific paths. This is useful when you want to exclude a whole subtree from your index configurations. e.g: You have a multi-site structure which contains 3 sites. You want to implement search funcationlity on one of the sites (call site A) and visitors should be able to search in site B content, but content from site C should not be visible, and you dont want to break relevancy of the search result. The first step is create a class, call CustomCrawler.cs. This class should be derived from SitecoreItemCrawler class. Now, you can overwrite IsExcludedFromIndex method. If you are ready, you should change crawler in the search config. Add paths to ExcludeRoot node and seperate them by pipes. That's all. Now items are not indexed from the excluded paths, and you don't break the relevancy.