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.

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'}