IContentList::Filter

Ee810506.c++_off(en-US,CS.10).gifEe810506.vb_on(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

HRESULT IContentList::Filter(VARIANTvColumn,VARIANTvFilterCriteria,FilterActionEnumFilterAction,BSTRComponent);

Parameters

vColumn

[in] A VARIANT 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

[in] A VARIANT that contains the filter criterion. The criterion is either a single BSTR, a SAFEARRAY of BSTRs, or an Integer.

FilterAction

[in] 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

[in,optional] A BSTR 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

This method returns an HRESULT indicating whether or not it completed successfully. See the Error Values section for more details.

Error Values

This method returns S_OK (0x00000000) to indicate success and standard COM HRESULT 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, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return 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.

See Also

ContentList Object


All rights reserved.