When using predictive search, which parameters are required? 🔍
### Explanation
When using Shopify's predictive search endpoint `/search/suggest.json`, only the `q` parameter is required:
```javascript
// Minimum required request
fetch("/search/suggest.json?q=shirt")
.then(response => response.json())
.then(suggestions => {
console.log(suggestions);
});
// Optional parameters can be added
fetch("/search/suggest.json?q=shirt&resources[type]=product")
.then(response => response.json())
.then(suggestions => {
const products = suggestions.resources.results.products;
console.log(products);
});
```
Key points:
- Only `q` (query) parameter is required
- `resources[type]` is optional for filtering
- `limit` is not a valid parameter
- Without `resources[type]`, returns all resource types
- Maximum 4 results per resource type
Reference: [Shopify Predictive Search API](https://shopify.dev/docs/api/ajax/reference/predictive-search)
Answer Options:
- q and resources[type]
- Only q
- q and limit
- q, resources[type], and limit