Created
February 11, 2019 10:09
-
-
Save Mitya88/542b102f7c84d3a87eb02417cb4b3718 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ExcludeClonedItemsCrawler : SitecoreItemCrawler | |
{ | |
protected override bool IsExcludedFromIndex(SitecoreIndexableItem indexable, bool checkLocation = false) | |
{ | |
var obj = (Item)indexable; | |
if (obj.IsClone) | |
{ | |
this.Index.Locator.GetInstance<IEvent>().RaiseEvent("indexing:excludedfromindex", (object)this.index.Name, (object)obj.Uri); | |
return true; | |
} | |
return base.IsExcludedFromIndex(indexable, checkLocation); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment