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/createRecentSearchesPlugin.md
+81-12Lines changed: 81 additions & 12 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: createRecentSearchesPlugin
3
3
---
4
4
5
+
The Recent Searches plugin displays a list of the latest searches the user made.
6
+
7
+
The `createRecentSearchesPlugin` plugin lets you implement your own storage. To connect with the user's [local storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage), check [`createLocalStorageRecentSearchesPlugin`](createLocalStorageRecentSearchesPlugin).
This example uses the plugin within [`autocomplete-js`](autocomplete-js). You're in charge of implementing the storage to fetch and save recent searches.
You can combine this plugin with the [Query Suggestions](createQuerySuggestionsPlugin) plugin to leverage the empty screen with recent and popular queries.
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.
209
+
210
+
This function enhances the provided search parameters by:
211
+
212
+
- Excluding Query Suggestions that are already displayed in recent searches.
213
+
- Using a shared `hitsPerPage` value to get a group limit of Query Suggestions and recent searches.
0 commit comments