--- title: Migration Guide --- ## Moving from v2 to v3 This article provides a set of guidelines to migrate from v2 to v3. ### 1. Update the imported JS & CSS libraries ```html ``` ### 2. Update the JS snippet to instantiate DocSearch ```html ``` #### Replace `inputSelector` with `container` The `container` argument is a [CSS selector][1] matching the HTML element to feature. This element used to be an `` with DocSearch v2. The JS snippet call replaces the first matching element with the DocSearch button. This button opens the search modal. For example, the minimalist required structure and imports are: ```html
``` #### Replace `algoliaOptions` with `searchParameters` With the v2, if you wanted to forward search parameters to the Algolia API, you needed to set the `algoliaOptions` input. It has been replaced with `searchParameters`. This argument is [commonly used to filter on specific `facetFilters`][2] such as version or language. You [can find out the exhaustive list of `searchParameters` availabe in the Algolia documentation][3]. [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors [2]: https://www.algolia.com/doc/api-reference/api-parameters/facetFilters/ [3]: https://www.algolia.com/doc/api-reference/search-api-parameters/