Spellchecking#

Profiles: Project Creator, Search User

This feature enables the user to spellcheck a potential query based on the data which is loaded in Squirro.

To achieve this, Squirro makes use of the Elasticsearch suggester functionality.

Search users are presented with spelling suggestions if an incorrectly-spelled query is identified by Squirro.

Project creators can configure spellchecking settings and determine how the feature is presented to search users.

How to Set Up Spellchecking#

If you are working with a project where spellchecking is not enabled by default, or you would like to add it to a custom dashboard, follow the steps below:

  1. Navigate to your project’s Setup space.

  2. Click the Visualization tab.

  3. Hover over the dashboard you’d like to edit, click the three dots to bring up the drop-down menu, and click Edit.

  4. Select a layer to add the widget to, or create a new layer.

  5. Add the Spelling Correction widget, as shown in the screenshot below:

Spellcheck Widget
  1. Configure the visibility conditions of the layer the widget sits within, if desired.

Reference: Learn more about Visibility Conditions within the Dashboard Editor.

Tip

Typically, you’ll want to set a visibility condition for the spellcheck widget to hide it when it’s not in use.

How It Works#

You can send a normal query/item request to the topic api (/v0/{tenant}/projects/{project_id}/items/query) in addition to the query you add a tag spellcheck in the following format:

'spellcheck': {'text': 'squiro','field': 'body.en.unstemmed'}

The field text holds the query on which you would like to have a suggestion and the field field takes the Elasticsearch index in which the spellchecker respectively Elasticsearch needs to look for similar words.

The topic api then picks the suggested word with the highest score from the Elasticsearch response. As a response you get in addition to the query results a dictionary with suggestions to your spellcheck query:

'spellcheck': {'original': 'squiro', 'corrected': 'squirro'}