Spellcheck API
The QSC Spellcheck automatically correct misspelled search queries.
There are different scenarios to correct the search query.
- The search query is correct. The query is not corrected.
- Misspelled search query that can not be corrected. The query is not corrected.
- The spellcheck can correct the query with a confidence > 80% - The query is automatically corrected.
- 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"
}
}
parameters | description |
---|---|
name | The name of the result |
type=corrected | The search query was corrected automatically. |
corrected | The corrected query |
original | The 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"
}
}
parameters | description |
---|---|
name | The name of the result |
type=didYouMean | The search query was not corrected. But a suggest is returned. |
corrected | The corrected query as a suggest. |
original | The original query |