DefineKeywordHistogram Command

Two forms of histogramming requests are supported by Flexible Search: the Return Count requests and the Return Results requests. At most one histogramming request can be made within a single search request.

The Return Count requests can be used in addition to a simple request to return the number of items found in each category, range or time frame. Meanwhile, the data is returned, filtered and sorted without regard to category, range or time frame.

The Return Results requests are used in place of a simple request. In addition to the number of items being returned for each category, range or time frame, the actual data is filtered, sorted and returned by category, range or time frame for display.

The Return Count by Category requests is one of the Return Count requests, and is used to return the number of records found for each of a number of records found for each of a number of defined categories. A keyword index is used to define the categories. Either all categories defined by the index or a selected subset may be used.

Both the Return Count by Category and Return Results by Category requests use the DefineKeywordHistogram command. The Return Count by Category request uses the DefineKeywordHistogram command with only two arguments to return the number of categories containing items matching the search criteria, as well as the number of items matching the search criteria for each selected category.

To return a subset of the categories containing results matching the search criteria, pass the name of an HTML variable, containing the list of categories in the proper order, to the command as the second argument. To return all categories, pass the proper control character as the second argument: a plus sign (+) to display in ascending order, or a minus sign (-) to display in descending order.

To select a specific list of categories for display in a predetermined order, use the following format:

DefineKeywordHistogram( idx, lst );

DefineKeywordHistogram Arguments (Predetermined Order)

Argument

Description

idx

The keyword index to be searched.

lst

The name of the HTML variable containing the list of categories in the display order.


To select all categories for display, sorted in either ascending or descending order, use the following format:

DefineKeywordHistogram( idx, ctl );

DefineKeywordHistogram Arguments (Ascending/Descending Order)

Argument

Description

idx

The keyword index to be searched.

ctl

The display control character ( + or - ). The display control character may be passed directly or within an HTML variable.


To select a specific list of categories for display in a predetermined order, use the following format:

DefineKeywordHistogram( idx, lst, cnt );

DefineKeywordHistogram Arguments (Predetermined Order)

Argument

Description

idx

The keyword index to be searched.

lst

The name of the HTML variable containing the list of categories in the display order.

cnt

The maximum number of items to display for each category. The count may be passed directly or within an HTML variable.


To select all categories for display, sorted in either ascending or descending order, use the following format:

DefineKeywordHistogram( idx, lst, cnt );

DefineKeywordHistogram Arguments (Ascending/Descending Order)

Argument

Description

idx

The keyword index to be searched.

ctl

The display control character ( + or - ). The display control character may be passed directly or within an HTML variable.

cnt

The maximum number of items to display for each category. The count may be passed directly or within an HTML variable.

 

Access the DefineKeywordHistogram Dialog Box by selecting the Keyword Histogram menu item under the Categories category of the Logic Template editor command menu.

Examples

Return the number of results found for each category identified by the keyword index "Sources".

 

Command

Description

DefineKeywordHistogram( Sources, NewsSources );

Return the count for each of the categories identified within the HTML variable, "NewsSources".

DefineKeywordHistogram( Sources, + );

Return the count for each category, displaying those categories in alphabetical order.

DefineKeywordHistogram( Sources, - );

Return the count for each category, displaying those categories in reverse alphabetical order.

DefineKeywordHistogram( Sources, Direction );

Return the count for each category in either alphabetical or reverse alphabetical order as identified within the HTML variable, "Direction".

DefineKeywordHistogram( Sources, NewsSources, 5 );

Return up to 5 results for each of the categories identified within the HTML variable, "NewsSources".

DefineKeywordHistogram( Sources, +, 5 );

Return up to 5 results for each category, displaying those categories in alphabetical order.

DefineKeywordHistogram( Sources, -, Count );

Use HTML variable, "Count", to determine the number of results to be returned for each category, and display those categories in reverse alphabetical order.

DefineKeywordHistogram( Sources, Direction, 5 );

Return up to 5 results for each category in either alphabetical or reverse alphabetical order as identified within the HTML variable, "Direction".