Modified Query Component

Overview

The Modified Query component is rendered when the spellchecker detects a spelling error and searches for the correctly-spelled query instead.

This component is only visible for new searches. If the spellchecker revises a query and the user then performs an action such as applying facet or moving to another page of results, it is implied that the user accepts the correction.

Selector

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

Data Model

The following data model is exposed to the Handlebars template:

{ query: string; modifiedQuery: string; }

Event Binding Attributes

Attribute Name

Attribute Value

Attribute Name

Attribute Value

hawksearch-query

string (query to execute)

When an element with this attribute is clicked, a new search will be executed with the specified query and spellcheck functionality disabled. This is useful when the spellchecker mistakes a valid entry for another term.

Default Template

<div class="modified-query"> <p> Showing results for <span class="modified-query__modified">{{modifiedQuery}}</span>. Search instead for <a class="modified-query__original" hawksearch-query="{{query}}">{{query}}</a>. </p> </div>