# Using ObservableAggregator<T> to filter items

Abstract

Filtering items sent to observers using the ObservableAggregator<T> processor.

You can configure instances of ObservableAggregator<T> processors that filter out items that you do want to be not be sent to observers. All observables use the global aggregation.filter.inbound pipeline. You can add additional observable-specific pipelines.

You implement the global aggregation filter in XML. The following code adds two filters. The first one filters by contact ID and the second one by the path visited:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">  <sitecore>
<pipelines>
<!-- global aggregation inbound filters-->
<aggregation.filter.inbound>
<processor type="Sitecore.ContentSearch.Analytics.Pipelines.AggregationFilters.InboundContactIdFilter, Sitecore.ContentSearch.Analytics">
<filter>ca82109f-30cd-4414-956e-caea41c7510c</filter>
</filters>
</processor>
<processor type="Sitecore.ContentSearch.Analytics.Pipelines.AggregationFilters.InboundVisitPathFilter, Sitecore.ContentSearch.Analytics">
<filter>/default.aspx</filter>
</filters>
</processor>
</aggregation.filter.inbound>
</pipelines>
</sitecore>
</configuration>
You can configure each processor in the sample above with additional <filter> values.


You can configure an observable-specific pipeline in addition to the global filter pipeline. If you configure an observable called DefaultObservable, you simply configure a pipeline called defaultobservable.filter.inbound. For example:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<!-- define the aggregator -->
<aggregation>
<processor patch:before="*[1]"
type="Sitecore.ContentSearch.Analytics.AnalyticsObservableAggregator, Sitecore.ContentSearch.Analytics">
<!-- here we name the aggregator -->
<param desc="name">DefaultObservable</param>
</processor>
</aggregation>
<!-- specific inbound filter for an aggregator -->
<!-- we use the aggregator name from above in the pipeline name -->
<defaultobservable.filter.inbound>
<processor type="Sitecore.ContentSearch.Analytics.Pipelines.AggregationFilters.InboundVisitPathFilter, Sitecore.ContentSearch.Analytics">

This configuration uses exactly the same processor types as the global pipeline. Sitecore only applies the processors in the pipeline when the DefaultObservable processor is filtering items.