Instantsearch: infinite scroll - display pagination in URL

Does ability exist instantsearch to make pagination for infinte hits? So you click on the button “Sho more”, in browser url we see something like https://site.lo/category?page=3 (Now we see only https://site.lo/category?)

And when we move back, we display items only from https://site.lo/category?page=3

Appreciate any help.

Hi @faltsman,

I think I understand that you’d like the url to change in the address bar of your browser when you click the ‘Show More’ button.

I think what you are looking for is the showPrevious option on the infiniteHits widget.

Notice that you will also need to use the routing option in your instantSearch.

I have created a codesandbox to demonstrate.

I’m not sure if that satisfies your question about ‘moving back’. Clicking back in the browser may not produce the result you are expecting, but going to the url with a page request ( https://site.lo/category?page=3 ) should show the results for that page along with a ‘Show Previous Results’ button and a ‘Show Next Results’ button.

Does this work for you?