Embedding Search Query and Filters in URL with instantsearch.js

TLDR John inquired about embedding search query and filters into URLs with instantsearch.js. Jason responded with an affirmative, provided a solution and documentation link.

Photo of John
John
Thu, 03 Jun 2021 00:12:30 UTC

Hi, I'd like to know whether it is possible with have the search query and the filters be part of the URL, like on this site: - here the query was `mascara` and the filters are the part of the URL after the question mark. It would be so awesome to be able to save a search!

Photo of Jason
Jason
Thu, 03 Jun 2021 00:16:46 UTC

Yup! You just need to set `routing: true` when initializing instanstearch like this:

Photo of Jason
Jason
Thu, 03 Jun 2021 00:17:43 UTC

Documentation is here:

Photo of John
John
Thu, 03 Jun 2021 01:05:47 UTC

OK very nice!!! Thank you!:clap: