Plugin: Map URL parameters

Purpose

Use this plugin if you need to support non-standard query parameters when calling the search.

This plugin enables you to translate or map custom or non-standard URL parameters provided when calling the search to the correct input parameters required by the search.

When to use this plugin

  • Use this plugin if you are migrating to the Squiz DXP search from another search product, and you cannot easily update the input parameters provided by your integration. For example if your query is supplied with a URL like https://example.com/search?q=example+search you could use this plugin to map the q parameter value to the query parameter that is required when using Funnelback.

Usage

Enable the plugin

  1. Select Plugins from the side navigation pane and click on the Map URL parameters 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.

Source URL parameter

Configuration key

plugin.map-url-parameters.config.rewrite.*

Data type

string

Required

This setting is required

'Parameter 1' defines the source input parameter that will be extracted from the URL. The value defines the target input parameter that the 'Parameter 1' value will be mapped to. Supports parameters that are specified multiple times (such as what you might get from form checkboxes).

The value of the input parameter defined by the will be appended to, or replace the inputParameters or additionalParameters fields in the data model

Target parameter overwrite mode

Configuration key

plugin.map-url-parameters.config.overwrite.*

Data type

boolean

Default value

false

Required

This setting is optional

Sets the addition mode of the target input parameter. Parameter 1 should be set to the value of target input parameter. Acceptable values are false - add the value to the target parameter, preserving any existing values (this is the default); true - remove any existing values for the target parameter and replace with the mapped value.

  • The collection input parameter is protected parameter can and cannot be altered. e.g.

    Configuration key name Parameter 1 Value

    Source URL parameter

    collection

    exampleorg~sp-example

    is not allowed and will result in an error being written to the log files.

  • The source URL input parameter (value of the Parameter 1 field in your rule) will not appear as a custom key (e.g. inputParameters["SOURCE-URL-INPUT-PARAMETER]) in the data model when it is mapped using this plugin.

  • The source URL input parameter (value of the Parameter 1 field in your rule) can only be mapped to a single target parameter. If multiple Source URL parameter keys are set in the results page configuration with the same Parameter 1 value, only the first matching value will be used and the other mappings ignored. You can map multiple URL parameters, but each parameter can only be mapped to a single target input parameter.

Examples

Example: Map a non-standard parameter containing the query terms to the Funnelback query parameter

Consider a scenario where you are migrating to a Funnelback search and would like to maintain existing URL parameters.

In this example your query terms are passed in the search via a parameter, q. Funnelback uses the query parameter for this purpose the plugin will be configured to map whatever is passed in as the q value and set this as the value for query:

Configuration key name Parameter 1 Value

Source URL parameter

q

exampleorg~sp-example

Target parameter overwrite mode

query

true

If the URL called is something like http://search.example.com/search?q=dog this will result in the following being set in the search data model:

question.inputParameters["query"]=["dog"]
question.additionalParameters["query"]=["dog"]
the original q parameter will not be passed through to the search data model as it has been rewritten as query.

Example: Map a set of 'filter' parameters as metadata query constraints

Consider a scenario where you have a search that passes in several filter values from checkboxes in a form that you wish to add as a metadata constraint to your search.

Configuration key name Parameter 1 Value

Source URL parameter

filter

meta_searchFilters_orsand

If the URL called is something like http://search.example.com/search?q=dog&filter=small+size&filter=curly+hair this will result in the following being set in the Funnelback data model:

question.inputParameters["meta_searchFilters_orsand"]=["small size","curly hair"]

If your meta_searchFields_orsand parameter had any existing values (e.g. question.inputParameters["meta_searchFilters_orsand"] = ["pure bred"]) set then these will be preserved as the overwrite option is not set, and this would result in the following value in the data model: question.inputParameters["meta_searchFilters_orsand"] = ["pure bred","small size","curly hair"].

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.