This hook allows plugins to observe searches in the main search UI.

If the plugin sets the redirectPath response property, the user will be redirected away from the search results. Use this with caution.


Name Type Description
query String Search query
subset Ref Selected search subset


Return information by changing these properties of the response object.

Name Type Description
redirectPath String If set, the user will be redirected to this path instead of viewing the search results

JavaScript template

P.hook('hPreSearchUI', function(response, query, subset) {
    // Respond to hook, for example
    // response.redirectPath = ...