Skip to main content

Spellcheck API

The QSC Spellcheck automatically correct misspelled search queries.

There are different scenarios to correct the search query.

  1. The search query is correct. The query is not corrected.
  2. Misspelled search query that can not be corrected. The query is not corrected.
  3. The spellcheck can correct the query with a confidence > 80% - The query is automatically corrected.
  4. The spellcheck can correct the query with a confidence < 80% - The query is not corrected automatically. But the API returns a suggest for a corrected query.

Correct search query

In this case the search is executed and the results are shown.

Misspelled search query that can not be corrected

In this case the search is executed and a no result page is shown.

The spellcheck can correct the query with a confidence > 80%

The query is corrected automatically. The original query and the corrected query are returned in the didYouMeanResult

Example: Search für Gühlschrank

{
"statusCode": 200,
"result": { },
"time": 2771,
"currentTime": "2022-06-26T15:58:53+0000",
"requestId": "41472487-220b-4c80-aee9-15bcb92bb2c0",
"didYouMeanResult": {
"name": "spellCorrection",
"type": "corrected",
"corrected": "kühlschrank",
"original": "gühlschrank"
}
}
parametersdescription
nameThe name of the result
type=correctedThe search query was corrected automatically.
correctedThe corrected query
originalThe original query

To force the search executing the query with the wrong keyword, the spellcheck must be disabled.

GET API In the GET API the spellcheck is disabled by the query parameter ctrl=spellcheckDisabled

POST API In the POST API the spellcheck is disabled by result.spellcheck.enabled: false

{
"result" : {
"spellcheck": {
"enabled" : false

}
},
"q" : "gühlschrank"
}

The spellcheck can correct the query with a confidence < 80%

Example: Search für Wako

{
"statusCode": 200,
"result": {},
"time": 733,
"currentTime": "2022-06-26T15:50:27+0000",
"requestId": "89721a62-a70c-4a71-a422-f10b9d41d7e0",
"didYouMeanResult": {
"name": "spellCorrection",
"type": "didYouMean",
"corrected": "wago",
"original": "wako"
}
}
parametersdescription
nameThe name of the result
type=didYouMeanThe search query was not corrected. But a suggest is returned.
correctedThe corrected query as a suggest.
originalThe original query