Autocomplete
Search suggestions
Returns search suggestions grouped by type (products and categories) that match the provided search text. This endpoint is automatically triggered as users type in the search field.
How Autocomplete Works:
When a search text is provided, the system queries Elasticsearch using multiple match types to find the best matches:
Multi-match query across product search text fields
Phrase match for exact phrase matching
Phrase prefix match for partial phrase completion
If ES_MIN_SCORE_COEFFICIENT is greater than zero, a minimum score threshold is calculated and applied to filter low-relevance results.
The search query is then processed through sorting and pre-filtering functions based on current configuration. After processing, the most relevant 4 product results are returned. These 4 results represent product IDs that are automatically displayed in the search interface.
In addition to products, category suggestions are also generated. If categories match the search text, up to 4 category suggestions are returned and displayed at the top of the autocomplete results.
Suggestion Details:
Product suggestions include product name, URL, image, price, and retail price. Category suggestions include category name, URL, and parent category hierarchy showing the full category path.
If no search text is provided, an empty list of suggestions is returned.
Caching:
Results are cached for optimal performance using a two-layer cache system: 540 seconds expiration
The cache duration is configured to balance freshness with response speed.
Search query text
{"value":"smartwatch","summary":"Single word search"}Autocomplete suggestions retrieved successfully
Autocomplete suggestions retrieved successfully
Last updated
Was this helpful?

