Response Format
Name | Description |
---|---|
query |
The original query typed in by the user. |
corrected-query |
If spell correction made a change, this will be returned as the updated query, and will be used in generating search suggestions. |
suggested |
The top suggestion object. (See below) |
alternatives |
A list of additional suggestion objects. (See below) |
Suggestion Object Format
Name | Description |
---|---|
text |
The suggested query text to be shown to the user. |
type |
(Optional) The type of prefix match between the query and other data - popular queries, product names, product SKUs. If the entire query as it is written matches within the other data, "type" will be returned.
|
source |
(Optional) The source of data against which the query matched. (See "type" above) Possible values: "popular-query", "name", or "sku". |
popularity |
(Optional) The popularity rating of this search query, based on the past 90 days of shoppers searching on the site. |
completed |
(Optional) If the suggestion type is "completed", this array will also be returned to explain how the suggestion was created. |
Response Example
{
"query": "pnik dr",
"corrected-query": "pink dr",
"suggested": {
"text": "pink dress",
"type": "completed",
"completed": [
{
"token": "dress",
"query": "dr",
"type": "prefix"
}
],
"source": "popular-query"
},
"alternatives": [
{
"text": "pink dresses",
"type": "completed",
"completed": [
{
"token": "dresses",
"query": "dr",
"type": "prefix"
}
],
"source": "popular-query"
},
{
"text": "blush pink dress",
"popularity": 793
},
{
"text": "hot pink dress",
"popularity": 338
},
{
"text": "dreams pink",
"type": "completed",
"completed": [
{
"token": "dreams",
"query": "dr",
"type": "prefix"
}
],
"source": "name"
}
]
}
Comments
0 comments
Please sign in to leave a comment.