question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 10 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Haroenvcommented, Nov 14, 2022

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.

1reaction
flevi29commented, Nov 14, 2022

No, it’s true. image

I updated and simplified the reproduction repo. With an Algolia free tier if you select Sík SÔndor and then search for Sajó Géza and select it, it should happen.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found