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
{{ message }}
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.
When doing a multiple index query with several Index, allSearchResults is updated as many times as there are indices after searching instead of at once.
🔍 Bug reproduction
Steps to reproduce the behavior:
Open the sandbox
Type a letter in the search field
See the console:
Searching becomes true
Searching becomes false and the nbHits of the main index are updated
Only then the nbHits of the other index is updated
I would expect all the nbHits to be updated at the same time, when searching becomes false, because this means that searching is done and that everything was retrieved.
Environment
OS: macOS
Browser: Chrome
Version: 6.23.0
Additional context
I need everything to be updated at once because I need to send a segment event when we're done searching, with the number of results for each index. For this, I'm looking for a searching changing from true to false and need the number of hits to be updated at the same time.
The text was updated successfully, but these errors were encountered:
ksntcrq
changed the title
allSearchResults state is updated too many timesallSearchResults is updated too many times after searching
Mar 30, 2022
Hi @ksntcrq , thanks for filing this. It seems like an issue indeed, as searching is set to false as soon as the state is updated with the first index's results.
We're going to look at this, and in the meantime, you can work around this by thoroughly checking that the search parameters are identical in all indices. Here is a sandbox that checks for the query parameter for example: https://codesandbox.io/s/focused-nobel-jiket5?file=/src/App.js.
🐛 Bug description
When doing a multiple index query with several
Index
,allSearchResults
is updated as many times as there are indices after searching instead of at once.🔍 Bug reproduction
Steps to reproduce the behavior:
true
false
and thenbHits
of the main index are updatednbHits
of the other index is updatedLive reproduction:
https://codesandbox.io/s/kind-varahamihira-srcdhn?file=/src/App.js
💭 Expected behavior
I would expect all the
nbHits
to be updated at the same time, whensearching
becomes false, because this means that searching is done and that everything was retrieved.Environment
Additional context
I need everything to be updated at once because I need to send a segment event when we're done searching, with the number of results for each index. For this, I'm looking for a
searching
changing fromtrue
tofalse
and need the number of hits to be updated at the same time.The text was updated successfully, but these errors were encountered: