Plugin: tabs - extra searches

Other versions of this plugin may exist. Please ensure you are viewing the documentation for the version that you are currently using. If you are not running the latest version of your plugin we recommend upgrading. See: list of all available versions of this plugin.

This plugin enables configuration of which extra searches to run when a specific tab is selected.

Extra searches provide the ability to show related content such as social media or events by allowing additional searches by to run in parallel to the main search. The standard product behavior is to run all extra searches on all tabs. This might not be desirable as the content is already being displayed in the main search.

e.g. It is unlikely that a social media extra search will be required on a tab which returns only social media results.

Usage

Enabling the plugin

The extra search functionality provided by this plugin requires that a tab is explicitly selected. It is highly recommended specifying a default tab by using the tabs-set-default plugin

Enable the extra-search-per-tab plugin on your results page from the Extensions screen in the administration dashboard or add the following results page configuration to enable the plugin.

plugin.extra-search-per-tab.enabled=true
plugin.extra-search-per-tab.version=1.0.0
The plugin will take effect as soon as it is enabled.

Plugin configuration options

The plugin requires that the tabs are set up using a facet of type tabbed and the facet must have a name of Tabs (case-sensitive).

The following settings must be added to the results page configuration to enable the plugin:

  • plugin.extra-search-per-tab.config.extra_search_to_enable: The set of extra searches that will run on tabs that do not explicitly override this default. The value should be set to a comma-delimited list of extra search names and can be set to an empty value. e.g. <extra_search_name_1>,<extra_search_name_2>

  • plugin.extra-search-per-tab.config.extra_search_to_enable.override_for.<tab_label>: The set of extra searches that will run for the tab named <tab_label>, overriding the extra_search_to_enable (above). The value should be set to a comma-delimited list of extra search names and can be set to an empty value. e.g. <extra_search_name_1>,<extra_search_name_2>

  • plugin.extra-search-per-tab.config.extra_search_to_disable: The set of extra searches that will NOT run on tabs which do not explicitly override this default. The value should be set to a comma-delimited list of extra search names and can be set to an empty value. e.g. <extra_search_name_1>,<extra_search_name_2>

  • plugin.extra-search-per-tab.config.extra_search_to_disable.override_for.<tab_label>: The set of extra searches that will NOT run for the tab named <tab_label, overriding the extra_search_to_disable (above). The value should be set to a comma-delimited list of extra search names and can be set to an empty value. e.g. ,`

Where:

  • <tab_label>: The name or display value of the of tab. This value is case-sensitive and must match the name defined in the faceted navigation configuration.

  • <extra_search_name_n>: The name of the extra searches to enable separated by a comma (,). These names must match the extra search names defined in the extra search configuration

'extra_search_to_disable' keys take precedence over extra_search_to_enable at all levels.

Examples

The examples below apply to the following scenario:

  • Four configured tabs: All results, Courses, Events, Social media

  • Four configured extra searches: courses, events, profiles, twitter

Disable courses, events and twitter extra searches on their respective tabs to prevent duplicate from showing

Duplicate results can appear when extra searches are displayed on tabs which are derived from the same content.

e.g. It is not useful to display course results from the extra search alongside course results from the courses tab as the content will be the same.

To prevent this from happening, set the following in the results page configuration:

# Not explicitly required in this scenario as all extra searches run by default
# plugin.extra-search-per-tab.config.extra_search_to_enable=courses,events,profiles,twitter
plugin.extra-search-per-tab.config.extra_search_to_disable.override_for.Course=courses
plugin.extra-search-per-tab.config.extra_search_to_disable.override_for.Events=events
plugin.extra-search-per-tab.config.extra_search_to_disable.override_for.Social media=twitter

alternatively (although more verbose):

plugin.extra-search-per-tab.config.extra_search_to_enable.override_for.Course=events,profiles,twitter
plugin.extra-search-per-tab.config.extra_search_to_enable.override_for.Events=courses,profiles,twitter
plugin.extra-search-per-tab.config.extra_search_to_enable.override_for.Social media=courses,events,profiles

Only display extra searches on the "All results" tab

It is fairly common approach to use extra searches on the "All results" tab to showcase the breadth of data improving content discover which would otherwise be hidden.

However, if a user was then to narrow down their search to a particular tab, it would suggest that they are looking for something in particular making extra searches on broad content less relevant. In this scenario, it would make more sense to disable extra searches on other tabs by using the following results page configuration:

plugin.extra-search-per-tab.config.extra_search_to_disable=courses,events,profiles,twitter
plugin.extra-search-per-tab.config.extra_search_to_disable.override_for.All results=

Disabling all extra searches by default

In the unlikely scenario that all extra searches need to be disabled by default, you can use the following result page configuration:

plugin.extra-search-per-tab.config.extra_search_to_disable=courses,events,profiles,twitter

Alternatively, you can use the following:

plugin.extra-search-per-tab.config.extra_search_to_enable=

All versions of extra-search-per-tab