Search Suggestions
Types
There are four main types of search suggestions in Search Studio: products, categories, suggestions, and content.
These types are reflected as result groups in Search Studio.
Products: the suggested products are the first search results matching the query
Categories: the suggested categories either match the characters entered (e.g., "headp" > headphones) or match the category of the products in the top results (e.g., query "iphone" > suggested category "Smartphones")
Suggestions: the suggested queries come from two possible sources - automatically suggested popular queries or manually-entered queries. Both can be configured under Result Manager > Autocomplete Queries.
Note: manually-entered query suggestions can take up to 24 hours to become active.
Content: if you have content pages like blog posts in your index, these can be organized into one or more result groups for your search suggestions.
The desired number of suggested products, categories, suggestions, and content pages is defined per result group.
API Response
The API response for the Get Search Suggestions endpoint includes all four types of search suggestions. They are identified by type:
"type": "products"
"type": "queries"
"type": "categories"
"type": "custom" (for content result groups)
For example, I might send the following query to the Search Suggestions endpoint:
query=headph
The response:
{
"searchResults": [
{
"type": "products",
"name": "Products",
"totalResults": 12,
"totalResultsVariants": 12,
"totalResultsHead": 12,
"totalResultsHeadVariants": 12,
"results": [
[
{
"identifier": "4455670",
"groupId": "4455670",
"sxId": 241689241,
"dataPoints": [],
"image": "www.myshop.com/product/4455670/img.jpg",
"name": "Headphones X",
"images": [
{
"type": "ALTERNATIVE",
"url": "www.myshop.com/product/4455670/img.jpg"
}
],
"link": "www.myshop.com/product/4455670",
"resultSet": null,
"head": true,
"relevance": 1000000
}
],
[
{
"identifier": "4455668",
"groupId": "4455668",
"sxId": 241689232,
"dataPoints": [],
"image": "www.myshop.com/product/4455668/img.jpg",
"name": "Headphones O",
"images": [
{
"type": "ALTERNATIVE",
"url": "www.myshop.com/product/4455668/img.jpg"
}
],
"link": "www.myshop.com/product/4455668",
"resultSet": null,
"head": true,
"relevance": 999999
}
],
[
{
"identifier": "7890123",
"groupId": "7890123",
"sxId": 241689222,
"dataPoints": [],
"image": "www.myshop.com/product/7890123/img.jpg",
"name": "Headphones F",
"images": [
{
"type": "ALTERNATIVE",
"url": "www.myshop.com/product/7890123/img.jpg"
}
],
"link": "www.myshop.com/product/7890123",
"resultSet": null,
"head": true,
"relevance": 999998
}
]
]
},
{
"type": "queries",
"name": "Suggestions",
"totalResults": 1,
"results": [
{
"name": "new headphones"
}
]
},
{
"type": "categories",
"name": "Categories",
"totalResults": 1,
"results": [
{
"link": "www.myshop.com/c/headphones",
"name": "Headphones"
}
]
},
{
"type": "custom",
"name": "Blog",
"totalResults": 1,
"results": [
{
"image": "www.myshop.com/headphones-blog-image.png",
"images": [],
"name": "Best Headphones Guide",
"link": "www.myshop.com/blog/best-headphones-guide",
"dataPoints": [],
"type": "HTML",
"relevance": 45.37529
}
]
}
],
"totalResults": 13,
"interpretedQuery": {
"matchSources": []
},
"showAllResults": true
}