Search suggestions
POST/indexes/{index_name}/recommendations/queries
Purpose
Help shoppers find relevant products faster by suggesting query terms as they type. Reduces zero-results and accelerates navigation to high-intent pages.When to use
- Search bar suggestions on desktop and mobile
- Inline suggestions within site-wide navigation
Example uses
- Search as you type, show popular queries after typing in 2-3 characters
Example (cURL)
Parameters
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
| q | string | yes | Partial query text typed by the user. | "iph" |
| limit | integer | no | Max number of suggestions. Default 10. | 5 |
| userId | string | no | Optional user identifier for personalization. | "abc123" |
| sessionId | string | no | Optional session identifier. | "xyz789" |
q is not provided (or an empty string), top limit queries will be returned.