Configuring Hawksearch Results Widget
Goal
This document provides information about configuring the ‘Hawksearch results’ widget.
Prerequisite
Configured Sitefinity Connector
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.
Note
All configurations applied in the Data field in the Advanced settings are in JSON single-line format. You can use any JSON formatting tool to edit them more efficiently and then import them back.
Important
Keep in mind, that when using the Vue SDK and both Hawksearch box and Hawksearh results widgets are placed on the same page and if they have the same index set, or if the results widget has an empty index name configuration, then the widgets are practically synchronized. Therefore, performing any searches will populate the result set accordingly without refreshing the page.
In cases where these widgets should work together, make sure that both of them have the same correct configuration. For instance, if the box widget does NOT have the landing page set, but the results widget is configured with it, the request would not have the landing page context, because the box widget has priority over the results widget.
Enable SPA Search Box
Note
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
- 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
Note
You can filter the search results elevating Hawksearch Landing page functionality.
You can find more information about setting Landing Pages in Hawksearch documentation
- 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
Important
Landing Page URL must not have trailing slash, either in the Hawksearch engine configuration or in the widget Data field.
Configuring Facet Behavior
Important
This feature is only available for the Vue SDK
- 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": {...}}
- Click Save
- Publish the page
Configuring the Search Field
Important
This feature is only available for the Vue SDK
- 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.
{"_searchBoxConfig":{"reloadOnEmpty":false}}
- The configuration fields have the following usage:
- reloadOnEmpty - Refresh the search results with an empty keyword, but keeps all other facet selections
- Click Save
- Publish the page
Configuring Tabs
Important
This feature is only available for the Vue SDK
- 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.
{"_tabConfig":{"alwaysOn":true}}
- The configuration fields have the following usage:
- alwaysOn - There is always a selected tab. It cannot be de-selected, only new tab selection changes the tab value. This will also trigger an additional initial request for setting the default tab.
- Click Save
- Publish the page
Configuring URL Parameters Update
Important
This feature is only available for the Vue SDK
- 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.
{"_urlUpdate":{"enabled":true}}
- 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
Important
This feature is only available for the Vue SDK
- 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.
{"_searchConfig":{"scrollUpOnRefresh":true}}
- 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
Important
This feature is only available for the Vue SDK
- 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.
{"_resultItem":{"itemSelect":true,"linkField":"pageurl"}}
- The configuration fields have the following usage:
- itemSelect - Selecting the result item will open the details page
- linkField - Specifies which result field should be used for the redirect link
- Click Save
- Publish the page
Configure the Suggestion Item
Important
This feature is only available for the Vue SDK. It is available when one or more of the configured fields in the dashboard for a title and a link are missing. It also handles multilingual field support.
- 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.
{"_suggestionItem":{"linkField":"link","titleField":"title"}}
- The configuration fields have the following usage:
- titleField - Specifies which autocomplete output field to display as the title
- linkField - Specifies which autocomplete output field should be used for the redirect link
- Click Save
- Publish the page
Configure Pagination Links for SEO
Important
This feature is only available for the Vue SDK.
- 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.
{ "_pagination":{"type":"link"}}
- This setting will expose all pager links for SEO.
- Click Save
- Publish the page
Updated about 2 months ago