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 theq
parameter value to thequery
parameter that is required when using Funnelback.
Usage
Enable the plugin
-
Select Plugins from the side navigation pane and click on the Map URL parameters tile.
-
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 |
|
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 |
|
Data type |
boolean |
Default value |
|
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.
|
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 |
|
|
Target parameter overwrite mode |
|
|
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 |
|
|
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"]
.