Overview
The Hawksearch box widget comes with a ReactJS powered front end which has the latest features exposed to the Hawksearch service.
Goal
This document provides information on setting up the Hawksearch box widget using React. Basic usage is covered in Selecting React or Vue and any additional information may be found here.
Prerequisite
Configured Hawksearch box widget.
Steps for setup
Open the selected widget template file
Uncomment, if necessary, the part of the markup designated as React template. This should include a
div
element with attributedata-component="react-search-box"
ordata-component="react-search-box-bootstrap"
. It should be an emptydiv
element. Comment the part marked as Vue template. Only this step is required for enabling the component, the rest of the steps are optional.Modify the
data-client-guid
attribute to set the Hawksearch client ID.Modify the
data-hawksearch-base-api
attribute to set the Base API URL.Modify the
data-hawksearch-search-api
attribute to set the Search API URLModify the
data-json-params
attribute (JSON object, param_name: param_value) to set additional search parameters, specific for the widget instance.Modify the
data-index-name
attribute to set index for the widget search requests.Modify the
data-search-page
attribute to set the page to which the search should redirect.Save, re-build and refresh the page.