Refinement list items count is wrong in certain scenarios
See original GitHub issueš Bug description
In refinement list when I select an item that has a high count number and an item that has a low count number, the item with the low count number will suddenly return a 0 count. This low count item is selected after facet searching for it, so normally it is out of the view when nothing is selected.
š Bug reproduction
Reproduction repo: https://github.com/flevi29/refinement_list_bug
Live reproduction:
š Expected behavior
I expect the selected item with the low count to keep itās count.
š„ Screenshots
Environment
- OS: Windows 11
- Browser: Firefox
- Version: 106.0.5 (64-bit)
Additional context
I thought to post this on react-instantsearch-hooks-web
but initially I had the same problem with Angular, so I concluded itās an instantsearch.js
bug
Issue Analytics
- State:
- Created 10 months ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Continue to show a selected refinement when it's ... - GitHub
The user want to be able to keep track of already selected refinements in his refinement list, even when its count would imply...
Read more >Instantsearch.js Stats widget showing wrong values after ...
Click the top-most refinement item (2016) and the stats widget will match the count in the refinement, as expected. Click the next refinement...
Read more >Python: Number Game Refinement (Example) | Treehouse Community
im debugging what i have right now and so when i type in a number, it tells me "local variable 'count' referenced before...
Read more >The Coot User Manual - MRC Laboratory of Molecular Biology
Coot is based on the concept of molecules. Maps and coordinates are different representations of molecules. The access to the molecule is via...
Read more >Align - PyMOLWiki
This returns a list with 7 items: RMSD after refinement; Number of aligned atoms after refinement; Number of refinement cycles; RMSD beforeĀ ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Technically this is a behaviour of the engine, which doesnāt forcibly return the facet which is selected to be shown. You can work around this by passing a high maxValuesPerFacet as such:
<Configure maxValuesPerFacet={500} />
, which doesnāt significantly slow down the search (just 1ms in my testing with your dataset).A real fix would be lower down the chain, where we should request the facet values in an extra query specifically for each of the individual applied filters, instead of the current logic where the refined values are requested in a single query.
Because of that, and the fact that this behaviour has existed for as long as faceting has had counts, Iām not sure that there could be a lasting solution for this yet.
No, itās
true
.I updated and simplified the reproduction repo. With an Algolia free tier if you select
SĆk SĆ”ndor
and then search forSajó Géza
and select it, it should happen.