Skip to content

Instantly share code, notes, and snippets.

@Mitya88
Created February 13, 2019 09:38
Show Gist options
  • Save Mitya88/e8e309ad8dd879a35f48c9966e3f6eb3 to your computer and use it in GitHub Desktop.
Save Mitya88/e8e309ad8dd879a35f48c9966e3f6eb3 to your computer and use it in GitHub Desktop.
protected override bool IsExcludedFromIndex(SitecoreIndexableItem indexable, bool checkLocation = false)
{
var obj = (Item)indexable;
if (!obj.Paths.FullPath.StartsWith(this.Root, System.StringComparison.OrdinalIgnoreCase))
{
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