Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

The Hawksearch results widget also has an implementation with ReactJS. This version provides the most common use cases of the search service.

Goal

This document provides information on setting up the Hawksearch results widget using ReactJS. Basic usage is covered in Selecting React or Vue and any additional information may be found here.

Prerequisite

Info

Configured Hawksearch results widget.

Configuring 'Hawksearch results' Widget

Steps for setup

  1. Open the selected widget template file

  2. Uncomment, if necessary, the part of the markup designated as React template. This should include a div element with attribute data-component="react-app" or data-component="react-app-bootstrap". It should be an empty div element. Comment the part marked as Vue template. Only this step is required for enabling the component, the rest of the steps are optional.

  3. Modify the data-client-guid attribute to set the Hawksearch client ID.

  4. Modify the data-hawksearch-base-api attribute to set the Base API URL.

  5. Modify the data-hawksearch-search-api attribute to set the Search API URL

  6. Modify the data-json-params attribute (JSON object, param_name: param_value) to set additional search parameters, specific for the widget instance.

  7. Modify the data-index-name attribute to set index for the widget search requests.

  8. Modify the data-show-searchbox attribute to toggle the visibility of the search field.

  9. Save, re-build and refresh the page.