Plugin: Dynamic date filtering

Purpose

Use this plugin to restrict your search results to items with past or future dates.

When enabled, the plugin will restrict the search results based on the search results indexed date (value of the result’s date field). This allows you to restrict the search to only return results with a future or past date.

  • When date-mode=future is set as a request parameter, results are restricted to items with a date in the future (includes items with today’s date). This results in the plugin setting meta_d3=ddMMMYYY, which will be reflected when viewing the search data model.

  • When date-mode=past is set as a request parameter, results are restricted to items with a date in the past (this does not include items with today’s date). This results in the plugin setting meta_d2=ddMMMYYY, which will be reflected when viewing the search data model.

  • When date-mode=all is set as a request parameter, the date-mode parameter is missing, empty or set to anything else, the plugin is disabled and all the results are not restricted by date.

Additional date search and filtering options

Faceted navigation date-based filtering can be used to filter your search result on a number of preset dynamic date ranges (today/tomorrow/coming month/past year etc.).

Search queries can also be restricted to a specific date or date range using date metadata CGI parameters.

If any date metadata CGI parameter (e.g. meta_d1) is specified, the plugin will be disabled, and the results will be filtered based on the selected date.

Usage

Enable the plugin

  1. Select Plugins from the side navigation pane and click on the Dynamic date filtering 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.

Default date mode

Configuration key

plugin.dynamic-date-filtering.config.default_mode

Data type

string

Default value

FUTURE

Allowed values

FUTURE,PAST,ALL

Required

This setting is optional

If no date-mode query parameter is provided, fallback to this mode.

Additional configuration settings

Query parameter date-mode

Set date-mode query parameter for search URL to enable filtering by future/past date.

Value Outcome

future

Shows only events occurring today and in the future

past

Shows only events that occurred in the past

all

Shows all results regardless of the date

(empty) or (any other value)

Shows all results regardless of the date

If the parameter is not set then the chosen plugin default will apply.

Examples

Consider a set of search results containing the following:

  • result 1 with date 16 Jul 2025

  • result 2 with date 17 Jul 2025

  • result 3 with date 18 Jul 2025

and assuming today is 17 Jul 2025.

Filter by future date

To filter search results by future date including today date, add query parameter date-mode=future to search URL, (for example http://search.example.com/search.html?collection=example~sp-example&date-mode=future). This will result in the following search results being returned:

  • result 2 with date 17 Jul 2025

  • result 3 with date 18 Jul 2025

Filter by past date

To filter search results by past date, add query parameter date-mode=past to search URL, (for example http://search.example.com/search.html?collection=example~sp-example&date-mode=past). This will result in the following search results being returned:

  • result 1 with date 16 Jul 2025

Return all dates

To return all results, add query parameter date-mode=all to search URL, (for example http://search.example.com/search.html?collection=example~sp-example&date-mode=all). This will result in the following search results being returned:

  • result 1 with date 16 Jul 2025

  • result 2 with date 17 Jul 2025

  • result 3 with date 18 Jul 2025

Change log

Acknowledgements

A special thank you to the following individuals for helping to develop and maintain this project:

  • Chris Atwood - Cardiff University