Share via


ContentList.Filter Method (PIA)

Use this method to filter items in a ContentList object. Items that do not pass the filter have their scores set to zero (0).

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Caching
…
Public Sub Filter(vColumn As Object,
 vFilterCriteria As Object,
 FilterAction As FilterActionEnum,
 OptionalComponent As String)

[C#]

using Microsoft.CommerceServer.Interop.Caching;
…
public void Filter(object vColumn,
 object vFilterCriteria,
 FilterActionEnumFilterAction,
 stringComponent);

Parameters

[Visual Basic .NET]

  • vColumn
    An Object that identifies the column for which the index will be built. The column is identified by either a number representing a column position, starting at zero (0), or a string containing a column name.
  • vFilterCriteria
    An Object that contains the filter criterion. The criterion is either a single String, an array of Strings, or an Integer.
  • FilterAction
    An enumeration value. Valid values are FILTER_REQUIRE and FILTER_EXCLUDE. See the Remarks section for more information about the consequences of these two actions.
  • Component
    A String that is intended to contain the name of the pipeline component doing the filtering. This parameter is optional and is used for score tracing. Trace messages will be generated for content items that are filtered out.

[C#]

  • vColumn
    A object that identifies the column upon which to filter. The column is identified by either a number representing a column position, starting at zero (0), or a string containing a column name.
  • vFilterCriteria
    A object that contains the filter criterion. The criterion is a single string, a System.Array of strings, or an int.
  • FilterAction
    An enumeration value. Valid values are FILTER_REQUIRE and FILTER_EXCLUDE. See the Remarks section for more information about the consequences of these two actions.
  • Component
    A string that is intended to contain the name of the pipeline component doing the filtering. This parameter is optional and is used for score tracing. To omit this parameter set to Type.Missing. Trace messages will be generated for content items that are filtered out.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

Remarks

An item in the ContentList object matches the criteria if the value for the specified column exactly matches a string or number passed in the vFilterCriteria parameter. If the vFilterCriteria parameter is an array of strings, matching any one of the strings in the array is considered a match. If the FilterAction parameter is set to FILTER_REQUIRE, non-matching items have their scores set to zero (0). If the FilterAction parameter is set to FILTER_EXCLUDE, matching items have their scores set to zero (0).

For the sake of uniformity, the pipeline components provided with Commerce Server 2002 pass their own ProgID for the Component parameter.

[Visual Basic .NET]

Example

myContentList.Filter("Score", 3, FILTER_EXCLUDE)

Requirements

Namespace: Microsoft.CommerceServer.Interop.Caching

Platforms: Windows 2000, Windows Server 2003

Assembly: cachecomplib (in cachecomplib.dll)

See Also

ContentList Class

Copyright © 2005 Microsoft Corporation.
All rights reserved.