Home > widget-integration > InstantSearchService > cacheSuggestionData
InstantSearchService.cacheSuggestionData() method
Cache suggestion data in localStorage for analytics.
**Legacy**: setLocalStorage(SUGGESTION_DATA, { query, id, suggestions }) **New**: Dedicated method with typed structure
Signature:
protected cacheSuggestionData(query: string, data: SuggestionResponse): void;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
query |
string |
Search query |
|
data |
Suggestion response data |
Returns:
void