instantsearch: setIndex should not set page to 0 (and any other method)
I understand why it was there in the first place (the setPage(0)) but it the snippet bellow will not load page 2. And I think it is not what we want.
helper.setCurrentPage(2);
helper.setIndex(indexName);
helper.search()
About this issue
- Original URL
- State: open
- Created 9 years ago
- Comments: 27 (23 by maintainers)
Commits related to this issue
- fix(pagination): we need to force page in searchFunction helper does a setPage(0) on almost every method call see https://github.com/algolia/algoliasearch-helper-js/blob/7d9917135d4192bfbba1827fd9fb... — committed to algolia/algoliasearch-wordpress by vvo 8 years ago
- fix(instantsearch): pagination issue https://github.com/algolia/algoliasearch-helper-js/issues/121 — committed to algolia/algoliasearch-zendesk by Jerska 8 years ago
- fix(instantsearch): pagination issue https://github.com/algolia/algoliasearch-helper-js/issues/121 — committed to algolia/algoliasearch-zendesk by Jerska 8 years ago
+1. I spent hours figuring out what was happening. I based my
searchFunction
on what is provided by https://www.algolia.com/doc/api-reference/widgets/instantsearch/js/#widget-param-searchfunction But even though the comments state// we re-apply the previous page
, it’s so counter-intuitive and hard to understand!view more
,page 2
) does not work.page=0
Some clearer warning must be set somewhere about this
setPage()
usage withinsearchFunction
.Hello, I have an issue, probably linked to this one.
This workflow call right my page :
helper.clearRefinements
helper.setQueryParameter
helper.addFacetRefinement
helper.addDisjunctiveFacetRefinement
helper.on('result', function(){})
helper.setCurrentPage
helper.search
But in this order, it’s not working :
helper.setCurrentPage
helper.clearRefinements
helper.setQueryParameter
helper.addFacetRefinement
helper.addDisjunctiveFacetRefinement
helper.on('result', function(){})
helper.search
Maybe it’s important to document somewhere when we should call setCurrentPage ?
Have a nice day, Gaël