Skip to main content

Fuzzy Suggestions

Use case - Provide suggestions for search keywords with typos

Request

Method: POST

Endpoint: /v1.4/search

curl --location 'https://SEARCH_DOMAIN_URL/v1.4/search' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer cGFTZXXXXXXXXXXXXXXXA==' \
--data '{
"customer_id": "076XXXXXXXXXfb6",
"website_id": "c63XXXXXXXXXce",
"q": "SEARCH STRING",
"client": "CLIENT SHORTCODE",
"start": 0,
"size": 1
}'

Response

{
"type" : 1,
"code" : 0,
"payload": {
"aggregations": {
***
},
"result": [
***
],
"total_results": ***,
"suggestions" : {"fuzzy_suggestions": ["sample"]},
"redirects" : {***}
}
}

Fields

Field NameUsage
suggestionsReturns a dictionary containing a key element called fuzzy_suggestions containing all the suggestions for the search query if at all it had a typo