Plugin: Group search results

Purpose

Use this plugin if you need to group your search results by data source or a metadata field.

This plugin also includes additional options the limit the grouping to specific tabs.

Limitations

This plugin will group the search results that are returned in a single query to items from the same data source, or with the same metadata field value of a specified metadata field.

It will only group the results that were returned for the current page of search results (not the overall result set), so you may see repeated groupings when going from page to page of the search results.

There is a similar built-in feature, result collapsing, which provides a different way of grouping search results, and this operates on the entire result set. However, result collapsing combines the grouped set of results into a single main search result for which you can then browse the full set of results in the group. When viewing the main search results you have limited options to display the grouped results, and can only display a limited preview of the first n items in the collapsed group as a nested sub-result, plus a link to a secondary result page mentioned above.

When to use this plugin

Use this plugin:

  • if you need to group all the search results of a single page of search results into the different data sources.

  • if you need to group all the search results of a single page of search results by common metadata field values.

  • if you need to apply grouping that only applies to specific tabs.

When not to use this plugin

Do not use this plugin:

  • if you expect the groupings to persist across pages of results (e.g. all the book results in the full result set must be grouped before all the video results).

Usage

Enable the plugin

  1. Select Plugins from the side navigation pane and click on the Group search results tile.

  2. From the Location section, select the results page to which you would like to enable this plugin from the Select a results page select list.

The plugin will take effect as soon as you finish running through the plugin setup steps.

Configuration settings

The configuration settings section is where you do most of the configuration for your plugin. The settings enable you to control how the plugin behaves.

The configuration key names below are only used if you are configuring this plugin manually. The configuration keys are set in the results page configuration to configure the plugin. When setting the keys manually you need to type in (or copy and paste) the key name and value.

Grouping mode

Configuration key

plugin.grouping-results-by-criteria.config.mode

Data type

string

Allowed values

SOURCE,METADATA

Required

This setting is required

Defines the type of property that search results should be grouped by - either common data source (SOURCE) or metadata class value (METADATA).

Group by metadata class

Configuration key

plugin.grouping-results-by-criteria.config.metadata_class

Data type

string

Required

This setting is required

When grouping mode=METADATA, this defines the metadata class that will be used to group the search results. Set this to the metadata class ID. Results will then be grouped if they have a common value contained in that metadata class.

Tab facet name

Configuration key

plugin.grouping-results-by-criteria.config.tabs_facet_name

Data type

string

Default value

Tabs

Required

This setting is optional

If you wish to group results on specific tabs, then this defines the name of the tab facet. (As defined in the faceted navigation configuration)

Tabs where grouping should be applied

Configuration key

plugin.grouping-results-by-criteria.config.tabs

Data type

array

Required

This setting is optional

Set this to a comma-separated list of the tab category names where grouping should be applied. Default is to apply to all tabs.

Configuration key

plugin.grouping-results-by-criteria.config.target_facet

Data type

string

Required

This setting is optional

Specifies the name of a facet which should be used as a target for the the see more links. Must match the name of a defined facet.

This facet can be any facet that is defined for the search. Clicking the generated see more link will apply the facet, selecting the category defined in the corresponding group label field, which will return the group of results.

Default: If using SOURCE mode, the data source name. If using METADATA mode, the metadata class name.

Group label

Configuration key

plugin.grouping-results-by-criteria.config.link_label.*

Data type

string

Required

This setting is optional

Label to display for the link to the group of results. parameter 1 corresponds to the value of the data source or metadata that is being used to group the results.

Clicking the see more link will return the set of search results, either by applying the facet defined in the corresponding See more link target facet and category defined by this group label.

If a facet is not defined, then clicking the see more link will re-run the current search and restrict the results to items from the same data source (if in SOURCE mode), or items with the same metadata field value set (if in METADATA mode).

Examples

Group search results by data source

Consider a university search where you have course, people, event and web results each indexed in separate data sources.

The following configuration can be used to group the search results by the data source.

Configuration key name Value

Grouping mode

SOURCE

Group search results by metadata value

Consider an ecommerce search where you have type metadata, mapped to the productType metadata class.

The following configuration can be used to group the search results by type.

Configuration key name Value

Grouping mode

METADATA

Group by metadata class

productType

Use search results grouping with tabs

Consider a membership association search that includes event and journal data sources.

The search includes a tab facet named Tabs which is configured with three tabs:

  • All results, containing all search results

  • Events, containing results from the exampleorg~ds-membership-association-events data source

  • Journals, containing results from the exampleorg~ds-membership-association-journals data source

The following configuration can be used to group the search results when viewing the all results tab, and produce see more links to the corresponding tabs.

Configuration key name Parameter 1 Value

Grouping mode

SOURCE

Tabs where grouping should be applied

All Results

Target facet name

Tabs

Group label

exampleorg~membership-association-events

Events

Group label

exampleorg~membership-association-journals

Journals

Change log

[1.1.0]

Changed

  • Updated to the latest version plugin framework (Funnelback shared v16.20) to enable integration with the new plugin management dashboard.