1
0
Fork 0
docsearch/packages/website/docs/migrating-from-v2.md
Pierre Millot 93578a4de0
fix: upgrade algoliasearch to v5 (#2326)
We can use the new generated client to stay up to date and upgrade packages that depends on docsearch.

---------

Co-authored-by: shortcuts <vannicattec@gmail.com>
2024-10-30 15:46:38 +01:00

24 lines
754 B
Markdown

---
title: Migrating from DocSearch v2
---
This page lists the differences between the [DocSearch v2](/docs/legacy/dropdown) and [DocSearch v3](/docs/docsearch-v3) API, you can also take a look at [the exhaustive `API reference` list](/docs/api) and [the `Getting started` guide](/docs/docsearch-v3).
```diff
docsearch({
indexName: 'YOUR_INDEX_NAME',
apiKey: 'YOUR_SEARCH_API_KEY',
- inputSelector: '<YOUR_CSS_INPUT_SELECTOR>',
+ container: '<YOUR_CSS_CONTAINER_SELECTOR>', -> We now require a container to be provided
- appId: '<YOUR_OPTIONAL_APP_ID>',
+ appId: '<YOUR_REQUIRED_APP_ID>', -> `appId` is now required
- transformData: function(hits) {},
+ transformItems: function(items) {},
- algoliaOptions: {},
+ searchParameters: {},
});
```