Custom suggestions
Overview
Custom suggestions allows you to extend generated suggestions list with your own custom suggestions.
You can also add existing suggestion and increase its weight to make sure that the suggestion is always at the top.
Custom suggestion dashboard
Custom suggestions can be managed in a Custom Suggestion Dashboard. Make sure to select suggestion index from the environment selector.
Create suggestions
API Reference: Create custom suggestions.
To create a batch of new custom suggestions, issue a POST request with chosen suggestion index id:
POST v1/indices/{indexId}/customSuggestions
[
{
"title": "newest iphone 15",
"weight": 1000
},
{
"title": "iphone 13",
"weight": 500
},
{
"title": "iphone 11",
"weight": 250
}
]
title
- custom suggestion phrase; it is best to use a lowercase string; title length must be between 2 and 255;weight
- relative suggestion weight. Must be between 1 and 100 000.
Response body will include success status and a batch key that you can use to check suggestion creation progress by using Tasks API:
{
"batchKey": "suggestion-import-1658152770840-d7m",
"success": true
}
List suggestions
API Reference: Get custom suggestions.
To list existing suggestions in an index, issue a GET request with selected suggestion index id:
GET v1/indices/{indexId}/customSuggestions
Response will include a list of custom suggestions in that index:
[
{
"id": 1,
"title": "custom suggestion",
"weight": 10000,
"createdAt": "2021-07-18T13:59:30.000Z"
}
]
Delete suggestions
API Reference: Delete custom suggestions
You can use a list of suggestion ids to delete multiple suggestions at once using a POST request:
POST v1/indices/{indexId}/customSuggestions/batchDelete
{
"ids": ["1", "2", "3"]
}
Response will include the deletion success status:
{
"success": true
}