typesense / typesense-instantsearch-adapter

A JS adapter library to build rich search interfaces with Typesense and InstantSearch.js
MIT License
402 stars 63 forks source link

Infinite Scroll URL scroll until bottom page, if user refresh the page, the result will just show last page #160

Closed nogamenofun98 closed 1 year ago

nogamenofun98 commented 1 year ago

Description

Example of this demo website: https://songs-search.typesense.org/?s%5Bquery%5D=Annie%27s%20song%20Denver

If user scroll until bottom or maybe scroll until middle, If user copy that link or even refresh that page, the result will begin from that last visited page number. Is this normal or is something that is kinda like bug because user will feel weird why the result is incomplete.

Steps to reproduce

1) go to this demo website: https://songs-search.typesense.org/?s%5Bquery%5D=Annie%27s%20song%20Denver 2) Keep click "Show more results" until middle or last page. 3) Try refresh or copy the link and open in new tab 4) The result will begin from that page number, and the Number of result found is still count from page 1 to last page.

For a more extreme case like if user scroll until page 16 in this demo website https://songs-search.typesense.org/?s%5Bquery%5D=Annie%27s%20song%20Denver&s%5Bpage%5D=16

and If user refresh or maybe bookmark the link for later visit, and they found out the result is just few only, different with what they see before.

Expected Behavior

Maybe it should ignore the page number and begin from page 1?

Actual Behavior

It continue from the last visited page number in the url

Metadata

Typesense Version: v0.24.0

instantsearch-adapter version: v2.6.0

OS: Ubuntu 20.04

nogamenofun98 commented 1 year ago

I think the algolia instantsearch there also got similar issue open https://github.com/algolia/instantsearch/issues/5410

jasonbosco commented 1 year ago

This is controlled fully by Instantsearch and the typesense-instantsearch-adapter doesn't play a role in this behavior. So Instantsearch needs to address this issue, and we don't have a way to address this in the adapter.

Here's another issue talking about this behavior: https://github.com/algolia/instantsearch/issues/1972