为搜索创建出站过滤器

出站过滤器可用于过滤搜索结果。

出站过滤器使用的一个示例是从搜索结果中删除用户无权访问的项目。

出站过滤器在配置中设置:

<indexing.filterIndex.outbound>
 <processor type="Sitecore.ContentSearch.Pipelines.IndexingFilters.ApplyOutboundSecurityFilter, Sitecore.ContentSearch"></processor>
</indexing.filterIndex.outbound>

出站过滤器实现示例:

public class ApplyOutboundIndexWorkflowFilter : OutboundIndexFilterProcessor   
{        
    public override void Process(OutboundIndexFilterArgs args)       
    { 
        //You can use args.IsExcluded to remove items from the search results here
    }
}

更多示例和信息可以在 http://www.sitecore.net/learn/blogs/technical-blogs/sitecore-7-development-team/posts/2013/04/sitecore-7-inbound-and-outbound- 找到。过滤 pipelines.aspx