1. 検索とアイテムのバケット

ObservableAggregator<T>を使用してアイテムをフィルタリングする

Version:
日本語翻訳に関する免責事項

このページの翻訳はAIによって自動的に行われました。可能な限り正確な翻訳を心掛けていますが、原文と異なる表現や解釈が含まれる場合があります。正確で公式な情報については、必ず英語の原文をご参照ください。

オブザーバーに送信したくない項目をフィルターで除外するObservableAggregator<T> プロセッサーのインスタンスを構成できます。すべてのオブザーバブルは、グローバルaggregation.filter.inboundパイプラインを使用します。監視可能なパイプラインを追加できます。

構成

グローバル集約フィルターはXMLで実装します。次のコードでは、2つのフィルターを追加します。最初のものは連絡先IDでフィルタリングされ、2番目のものはアクセスしたパスでフィルタリングされます。

<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">
          <filters hint="list:AddFilter">
            <filter>ca82109f-30cd-4414-956e-caea41c7510c</filter>
          </filters>
        </processor>
        <processor type="Sitecore.ContentSearch.Analytics.Pipelines.AggregationFilters.InboundVisitPathFilter, Sitecore.ContentSearch.Analytics">
          <filters hint="list:AddFilter">
            <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.

観測可能な特定のフィルター

グローバル フィルター パイプラインに加えて、観測可能な特定のパイプラインを構成できます。 DefaultObservableというオブザーバブルを設定する場合は、単にdefaultobservable.filter.inboundというパイプラインを設定するだけです。例えば:

<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">
          <filters hint="list:AddFilter">
            <filter>/other.aspx</filter>
          </filters>
        </processor>
      </defaultobservable.filter.inbound>
    </pipelines>
  </sitecore>
</configuration>

この構成では、グローバル パイプラインとまったく同じプロセッサの種類が使用されます。Sitecoreは、DefaultObservableプロセッサがアイテムをフィルタリングしているときにのみ、パイプライン内のプロセッサを適用します。

この記事を改善するための提案がある場合は、 お知らせください!