Query Suggestions Component

Overview

The Query Suggestions component displays a list of possible queries that the search engine detects the user may be looking for.

Selector

The selector for this component is <hawksearch-query-suggestions>.

Data Model

The following data model is exposed to the Handlebars template:

{ querySuggestions: Array<string>; }

Handlebars Helpers

Name

Parameter

Name

Parameter

query-suggestions

Array<string>

This helper function creates a comma-separated list of links with the hawksearch-query attribute, using the word “or” before the last link.

Event Binding Attributes

Attribute Name

Attribute Value

Attribute Name

Attribute Value

hawksearch-query

string

When an element with this attribute is clicked, a new search will be formed for the specified query.

Default Template

<div class="query-suggestions"> <p>Did you mean to search for {{query-suggestions querySuggestions}}?</p> </div>