parametersearch
This bundle provides a way to search for items in a store when the app starts up when a q parameter with the search term is appended to the app's URL.
You can define a list of actions to execute after a search completed. By default, these are the actions highlight, zoomto, and openpopup.
Usage
There must be a store configured in your app to search on. For example, to search within an AGS layer you can utilize the agssearch bundle to define a store.
In the following sample the app is started with a q and a source parameter.
Therefore a search for "berlin" is performed on the store that has the ID "myStoreId".
.../my-app/index.html?q=berlin&source=myStoreId
If the search returns a result, the actions configured in the actions property are triggered.
If a popup is defined for the store, the popup is opened automatically.
Configuration Reference
The following sample shows the configurable properties and their default values:
{
    "Config": {
        "actions": ["zoomto", "highlight", "openpopup"],
        "defaultStoreId": "",
        "maxResults": 5,
        "useOnlyFirstResult": true,
        "zoomto-point-scale": 1000,
        "<action-property>": "value"
    }
}
Properties
| Property | Type | Description | 
|---|---|---|
| actions | Array | A list of the IDs of the actions to execute after the search completes. See the bundle map-actions for a list of available actions. | 
| defaultStoreId | String | ID of the store to be used for the search when no store ID is defined in the sourceURL parameter. If neither thesourceURL parameter nor thedefaultStoreIdare defined the search and hence all associated actions are not executed. | 
| maxResults | Number | The number of results requested from the underlying search-apibundle. | 
| useOnlyFirstResult | Boolean | By default only the first item matching the search query is used. To react on multiple results, set this property to falseand make sure to use actions that can react on multiple items. | 
| <action-property> | Any | This is a placeholder for properties defined by actions listed in the property actions. | 
WARNING: The whole workflow is only started if all
actionsare available. Custom actions may require components which start late. The waiting is required to ensure that these actions are informed about the search results.
How to configure actions
For configuration options of the highlight and zoomto actions consider the map-actions documentation.
To use the openpopup action define a popupTemplate.
See map-actions how to add custom actions, too.
Consistency with the search-ui bundle
When using both the parametersearch and the search-ui in the same app, prefer to configure this bundle's maxResults property to the same value as the search-ui's maxResultsPerGroup property (this is the default).
Both the search-ui and this bundle rely on the search-api bundle to perform searches.
To make results consistent, both bundles should request the same number of results from the search-api.
This is especially important if the search-api's client side scoring algorithm is used.