Prepare and get flow
In v3 thesearch controller handles prepare and execute automatically. When you call get(), the controller prepares the query if needed and retries a 425 response until results are ready.
prepare() directly to cache expensive work before calling get().
Passing search IDs between pages
AsearchId returned from prepare() is valid for a short window and can be reused across page navigations to keep ranking and merchandising consistent.
searchId and pass it to a new search controller.
Debouncing autocomplete
For search-as-you-type, useautocomplete() and debounce the input in your framework or with createDebounce() from the SDK.
suggest() method also debounces, but new integrations should use autocomplete() with their own debounce logic.
Concurrent API calls
Callsearch.prepare() and autocomplete.get() concurrently for a fast search-as-you-type experience.
Aborting stale requests
Controllers are tied to a single request lifecycle. To abort a previous request (for example, when the shopper types a new character), dispose the old controller and create a new one.Next steps
Caching
Learn how the SDK caches requests and results.
Performance
Optimize your implementation for speed.