為搜尋建立出站過濾器
出站過濾器可用於過濾搜尋結果。
出站過濾器使用的一個示例是從搜尋結果中刪除使用者無權訪問的專案。
出站過濾器在配置中設定:
<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