You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/website/docs/createLocalStorageRecentSearchesPlugin.md
+50-13Lines changed: 50 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,37 @@
2
2
id: createLocalStorageRecentSearchesPlugin
3
3
---
4
4
5
+
The Recent Searches plugin displays a list of the latest searches the user made.
6
+
7
+
The `createLocalStorageRecentSearchesPlugin` plugin connects with the user's [local storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) to fetch and save recent searches. To plug your own storage, check [`createRecentSearchesPlugin`](createRecentSearchesPlugin).
With [Query Suggestions](createQuerySuggestionsPlugin):
50
+
You can combine this plugin with the [Query Suggestions](createQuerySuggestionsPlugin) plugin to leverage the empty screen with recent and popular queries.
A search function to retrieve recent searches from. This function is called in [`storage.getAll`](createRecentSearchesPlugin#storage) to retrieve recent searches and is useful to filter and highlight recent searches when typing a query.
Optimized [Algolia search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/). This is useful when using the plugin along with the [Query Suggestions](createQuerySuggestionsPlugin) plugin.
204
+
205
+
This function enhances the provided search parameters by:
206
+
207
+
- Excluding Query Suggestions that are already displayed in recent searches.
208
+
- Using a shared `hitsPerPage` value to get a group limit of Query Suggestions and recent searches.
0 commit comments