You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There should be a way to generate a previous page link using a bookmark.
Summary
Let's say I have 3 pages of results, Page 1, 2, and 3. It's a bit confusing, so bear with me please.
Page 1 returns a bookmark: bk-pg2. I can use this bookmark to generate a next link in Page 1. I can also pass a made-up bookmark for Page 2 to go back to Page 1. Let's use bk-dummy. And there will be no previous link in this page.
The user clicks on the next link in Page 1 and arrives at Page 2.
Page 2 returns a bookmark: bk-pg3. Now, I can use the made-up bookmark bk-dummy to generate a previous link to Page 1 (basically, just search for the same parameter without a bookmark). I can also use bk-pg3 to generate a next link to go to Page 3. In addition, I can also pass the current bookmark bk-pg2 to Page 3, so that it can use that to generate a previous link to Page 2.
The user, however, decides not to click the previous link and click the next link, then arrives at Page 3.
Page 3 now returns a bookmark: bk-pg4. To make things easier, let's just assume that I prefetch all the next link and determine that this bookmark will return no more results, therefore I won't display a next link here. But, Page 3 does receive the bookmark of Page 2, bk-pg2, and can use it to generate a previous link.
The user, now, decides to click the previous link and arrives at Page 2, again.
Now, the user is at Page 2, and my problem begins. From the user's perspective, if Page 2 has a previous link, it should lead to Page 1. However, even if I had passed a bookmark to Page 2 from Page 3, that bookmark would be the bookmark of Page 3, bk-pg3, which would only lead to Page 3, not Page 1!!!
A possible solution is to keep passing all previous bookmarks to the next page, but it just isn't a very elegant solution.
Desired Behaviour & Possible Solution
I guess/hope, if I reverse the sort order with the bookmark of the current page, CouchDB would give me the result of the previous page. But it doesn't currently.
The text was updated successfully, but these errors were encountered:
There should be a way to generate a previous page link using a bookmark.
Summary
Let's say I have 3 pages of results, Page 1, 2, and 3. It's a bit confusing, so bear with me please.
Page 1 returns a bookmark:
bk-pg2
. I can use this bookmark to generate a next link in Page 1. I can also pass a made-up bookmark for Page 2 to go back to Page 1. Let's usebk-dummy
. And there will be no previous link in this page.The user clicks on the next link in Page 1 and arrives at Page 2.
Page 2 returns a bookmark:
bk-pg3
. Now, I can use the made-up bookmarkbk-dummy
to generate a previous link to Page 1 (basically, just search for the same parameter without a bookmark). I can also usebk-pg3
to generate a next link to go to Page 3. In addition, I can also pass the current bookmarkbk-pg2
to Page 3, so that it can use that to generate a previous link to Page 2.The user, however, decides not to click the previous link and click the next link, then arrives at Page 3.
Page 3 now returns a bookmark:
bk-pg4
. To make things easier, let's just assume that I prefetch all the next link and determine that this bookmark will return no more results, therefore I won't display a next link here. But, Page 3 does receive the bookmark of Page 2,bk-pg2
, and can use it to generate a previous link.The user, now, decides to click the previous link and arrives at Page 2, again.
Now, the user is at Page 2, and my problem begins. From the user's perspective, if Page 2 has a previous link, it should lead to Page 1. However, even if I had passed a bookmark to Page 2 from Page 3, that bookmark would be the bookmark of Page 3,
bk-pg3
, which would only lead to Page 3, not Page 1!!!A possible solution is to keep passing all previous bookmarks to the next page, but it just isn't a very elegant solution.
Desired Behaviour & Possible Solution
I guess/hope, if I reverse the
sort
order with the bookmark of the current page, CouchDB would give me the result of the previous page. But it doesn't currently.The text was updated successfully, but these errors were encountered: