SearchCategory Class Methods

In this section, the SearchCategory class methods are presented in alphabetical order.

Syntax

GetAllAttributes()

Description

Use this method to return the union of all the attributes available across all the search definitions assigned to this search category.

Parameters

None.

Returns

An array of SearchAttribute objects.

Syntax

GetConfiguredFilterAttributes()

Description

Use this method to return a list of advanced search filter attributes defined and configured for the advanced search for this search category. These are the attributes that have been configured on the Advanced Search Fields page.

Parameters

None.

Returns

An array of SearchAttribute objects.

Syntax

GetFacetFilters()

Description

Use this method to return an array of facet filters for a specific search category. Dynamically building this array based on system metadata avoids the hard-coding of facet names in your PeopleCode programs. However, this means that this method can only be used for search categories defined on the local system (therefore, it cannot be used for universal search).

Parameters

None.

Returns

An array of FacetFilter objects.

Syntax

GetLastIndexedDateTime()

Description

Use this method to return a DateTime value representing the oldest index that is current from all the indexed search definitions in this category. If no search definition in this category has ever been indexed, this method returns Null.

Parameters

None.

Returns

A DateTime value.

Syntax

GetNonConfiguredFilterAttributes()

Description

Use this method to return a list of advanced search filter attributes defined but not configured for the advanced search for this search category. These are the attributes that have been defined for the search category but not configured on the Advanced Search Fields page.

Parameters

None.

Returns

An array of SearchAttribute objects.

Syntax

GetRequestedAttributes()

Description

Use this method to return the list of search attributes that have been configured as display-only attributes on the Display Fields page. Since this method returns the display label for these search attributes, you must also use the GetRequestedFields method to return the list of search fields to pass to the query API.

Parameters

None.

Returns

An array of SearchAttribute objects.

Syntax

GetRequestedFields()

Description

Use this method to return the list of search fields that have been configured as display-only attributes on the Display Fields page. This array can then be passed to the RequestedFields method of the SearchQuery class. Since this method returns the query field names for the search attributes, you must also use the GetRequestedAttributes method to return the display labels to display in the user interface.

Parameters

None.

Returns

An array of SearchField objects.

Example

PT_SEARCH:SearchCategory &cat = create PT_SEARCH:SearchCategory("MY_SRCH_CAT");
&qry.Categories = CreateArray(&cat);

&qry.RequestedFields = &cat.GetRequestedFields();

Syntax

SearchCategory(Name)

Description

Use this constructor to instantiate a SearchCategory object populated with the data from the specified saved definition.

Parameters

Field or Control

Definition

Name

The name of the search category to instantiate as a string.

Returns

A SearchCategory object.

Example

import PT_SEARCH:SearchCategory;

Local PT_SEARCH:SearchCategory &SrchCat = create PT_SEARCH:SearchCategory("MySrchCat");