ContentList.Filter

Ee785094.c++_on(en-US,CS.10).gifEe785094.vb_off(en-US,CS.10).gif

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

Sub Filter(vColumn As Variant,vFilterCriteria As Variant,FilterAction As FilterActionEnum,Component As String)

Parameters

vColumn

A Variant 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

A Variant 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.

Return Values

None.

Error Values

This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

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 2000 pass their own Programmatic Identifier (ProgID) for the Component parameter.

Example

myContentList.Filter "Score", 3, FILTER_EXCLUDE

See Also

ContentList Object


All rights reserved.