Configuring Hawksearch results widget
In this article you will find:
- 1 Goal
- 2 Prerequisite
- 3 Remark
- 4 Enable SPA search box
- 5 Associate with Landing Page
- 6 Configuring facet behavior
- 7 Configuring the search field
- 8 Configuring tabs
- 9 Configuring URL parameters update
- 10 Configure additional search behaviour
- 11 Configure the result item
- 12 Configure the suggestion item
- 13 Configure pagination links for SEO
Goal
This document provides information about configuring the ‘Hawksearch results’ widget.
Prerequisite
Configured Sitefinity connector - Connector: Activation
Remark
In order ‘Hawksearch result' widget to show results from the corresponding index during the first load of the page (without executing a search request) you must set the search index in the widget designer.
Enable SPA search box
You can set up the ‘Hawksearch results’ widget to work as a Single Page widget (to use its built-in search box).
As a prerequisite, you will need to create a V4 or V4L search index -Managing V4 Indexes, Managing V4L Indexes
Navigate to a Sitefinity page that has a placed ‘Hawksearch results’ widget
Open the widget designer
Check ‘Show Search Box’
Set search index
Publish the page
Associate with Landing Page
Configure Landing Page for the corresponding Hawksearch V4 instance
Navigate to a Sitefinity page that has a placed ‘Hawksearch results’ widget
Open the widget designer
Go to the Advanced section
In the Data field enter the Url of your Landing Page in the following format:
{"CustomUrl":"/landing-page-url"}
Click Save
Publish the page
Configuring facet behavior
Navigate to a Sitefinity page that has a placed ‘Hawksearch results’ widget
Open the widget designer
Go to the Advanced section
If you are using the Vue SDK you can apply the configuration to the facets. More specifically - if the facets can be selected multiple times or only one at a time. The default behaviour is multiple selections. If a facet needs to be a single option, the value in the Data field should be this:
{"_facetConfig": {"brand": "single", "color": "multiple", "size": "single"}}
The key-value pairs are using the facet field machine name (can be found in the request headers) as a key and either “single“ or “multiple“ as a value.
If you have a landing page configured - place the facet config on the same level:
{"CustomUrl": "...", "_facetConfig": {...}}
b. Facet collapsing configuration options
i. collapsedByDefault - If true the collapsible facets will be collapsed when facets are displayed.
ii. collapseAllExceptCurrentTarget - If true the facets will act like accordion. When one facet is expanded the others will collapse.
iii. collapseOnDefocus - If true the facets will collapse when the user clicks somewhere out of the facet area.
iiii. Example
3. Click Save
4. Publish the page
Configuring the search field
Navigate to a Sitefinity page that has a placed ‘Hawksearch results’ widget
Open the widget designer
Check ‘Show Search Box'. If the search field is not needed - leave it unchecked. The following settings won’t take effect if the search box is not available.
Go to the Advanced section
Input the search box configuration settings in the Data field.
Click Save
Publish the page
Configuring tabs
Navigate to a Sitefinity page that has a placed ‘Hawksearch results’ widget
Open the widget designer
Go to the Advanced section
Input the tab configuration settings in the Data field.
Click Save
Publish the page
Configuring URL parameters update
Navigate to a Sitefinity page that has a placed ‘Hawksearch results’ widget
Open the widget designer
Go to the Advanced section
Input the configuration settings in the Data field.
When the URL update is enabled, all aspects of the search will be populated as parameters in the URL. If this is not needed, disable this setting.
Click Save
Publish the page
Configure additional search behaviour
Navigate to a Sitefinity page that has a placed ‘Hawksearch results’ widget
Open the widget designer
Go to the Advanced section
Input the configuration settings in the Data field.
This setting will enable the page to scroll up to the top after the user input
Click Save
Publish the page
Configure the result item
Navigate to a Sitefinity page that has a placed ‘Hawksearch results’ widget
Open the widget designer
Go to the Advanced section
Input the configuration settings in the Data field.
Click Save
Publish the page
Configure the suggestion item
Navigate to a Sitefinity page that has a placed ‘Hawksearch results’ widget
Open the widget designer
Go to the Advanced section
Input the configuration settings in the Data field.
Click Save
Publish the page
Configure pagination links for SEO
Navigate to a Sitefinity page that has a placed ‘Hawksearch results’ widget
Open the widget designer
Go to the Advanced section
Input the configuration settings in the Data field.
This setting will expose all pager links for SEO.