Group By

Syntax: several select boxes and radio buttons

The Group By options control how and when to show an additional set of group-by (clustered or faceted) results for Parametric Search fields. Up to 50 fields may be selected. For each field selected, the search results' summary will contain an additional set of results: a list of distinct values of that field from the results that match the query, with a count of results for that value and a link to search for that value.

The Order By field determines how to order the Group By results: by count or field, ascending or descending.

The Max field determines the maximum number of Group By results to show. The default (if empty) is the same as Results per Page. In a meta search, if target profiles have different Max values for the same-name Field, an arbitrary target profile's Max is chosen and used.

The Length field determines the maximum length to use for any of the Group By results. Results longer than the value specified here will be truncated. If empty, it defaults to 14 characters.

The Bin Ranges field allows the Group By to be binned, i.e. have a group for each of a set of ranges of values, rather than a group for each distinct value. This may be useful for generating e.g. price-range groupings. If non-empty, the Bin Ranges value is a comma-separated list of ranges. Each range defines a bin, via an optional lower and upper bound separated by "..". Results are then grouped into these bins instead of distinct values.

For example, a Bin Ranges value of "50..100,100..250,250.." would group results into three bins: results greater than or equal to 50 but less than 100, results greater than or equal to 100 but less than 250, and results greater than or equal to 250. By default, a range includes its lower bound but not its upper bound, but inclusion/exclusion can also be specified by the first and last characters of the range: a square bracket indicates the bound is included, a curly brace indicates it is excluded. E.g. the range "{75..100]" does not include ("{") 75, but does include ("]") 100. If a bound is not given, it is unlimited; hence "250.." is 250 and up. The set of ranges for a Group By may have gaps between or overlap one another; thus any given result may appear in zero, one, or multiple bins, depending on range definitions.

If a given range value does not contain the ".." operator, then the entire range value is taken as the lower bound, and the upper bound is implicitly taken from the lower bound of the next range (if any). This allows a set of contiguous ranges to be specified merely as a list of separators. E.g. the range list "10,20,30" is equivalent to "10..20,20..30,30..".

Note that binning an Enum field may not work, as the underlying Enum Int values must be searched - and their ordering may differ from the dictionary ordering of the Enum tokens given in the ranges.

The Bin Display Names field sets the displayed names for each of the bins defined by Bin Ranges. If non-empty, its value is a comma-separated list of display text values, one per bin. There must be as many Bin Display Names values as there are Bin Ranges values. If a name value is empty, a name will automatically be generated for the bin, based on the lower and upper bounds of the range; e.g. "Under 50", "50 - 100", "250 and up". A literal comma may be included in the bin name by escaping it with a backslash, i.e. "\,".

Group Bys should be set in descending priority order, i.e. highest priority first. Not all Group Bys set may actually be performed during a search, depending on which are already used in infield queries, and the value of Max Group Bys. If fewer Group Bys are performed than are set, the highest priority Group Bys are the ones performed; the remainder will have links in the results to expand them if the user chooses to.

See here for more details on using Group By.


Copyright © Thunderstone Software     Last updated: Apr 18 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.