sitecore Search Create an inbound filter for the search


Inbound filter is applied when item is added to the search index and allows to specify whether item is included to the index or not.

Examples when inbound filter can be used - do not include standard values and previous versions of the item in the index.

Inbound filters are set in configuration:

 <processor type="Sitecore.ContentSearch.Pipelines.IndexingFilters.ApplyInboundIndexFilter, Sitecore.ContentSearch"></processor>

Code implementation:

public class ApplyInboundIndexVersionFilter : InboundIndexFilterProcessor   
    public override void Process(InboundIndexFilterArgs args)       
        var item = args.IndexableToIndex as SitecoreIndexableItem;

        if (!item.Item.Versions.IsLatestVersion())            
            args.IsExcluded = true;            

More examples and information could be found on