Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate entries on useInfiniteHits hits property #6182

Open
1 task done
andretauffer opened this issue May 6, 2024 · 0 comments
Open
1 task done

Duplicate entries on useInfiniteHits hits property #6182

andretauffer opened this issue May 6, 2024 · 0 comments
Labels
triage Issues to be categorized by the team

Comments

@andretauffer
Copy link

馃悰 Current behavior

We import the useInfiniteHits from react-instantsearch-core in a react native project.
On our infinite hits display we've noticed the seldom appearance of duplicates of items shown previously in the hits.
Our investigation has found that the hits property found in the API returned by useInfiniteHits had the duplicates of items that had the exact same objectID, and were the same in every other aspect but ranking.
The duplicates show up in consecutive queries usually:
image
And their only difference shown in ranking:
image

We've attempted to use your distinct property, but we could only use it with objectID which doesn't seem to work and that shouldn't be necessary either.
My questions here are:

  1. Is there some ranking configuration or hook configuration that we're missing to fix this scenario?
  2. Our platform constantly adds entries to the index. Could ranking be affected by new entries being added to the index? How would that affect ongoing queries?
  3. Is there a way for the algolia search to filter objectID duplicates before return? We wouldn't like to filter it ourselves on client side, since on an infinite scroll, at some point it could get to be a costly operation.

馃攳 Steps to reproduce

Scroll down on a view that uses useInfiniteHits.
I believe for it to actually be triggered you should be adding entries to the index that could affect the ranking, from one query to the next.

Live reproduction

Don't really know how to reproduce it on a sandbox. Read the steps to reproduce

馃挱 Expected behavior

We'd expect that data doesn't get duplicated. Hopefully the query would automatically exclude duplicates based on objectID, but otherwise an opt-in feature could allow you to remove that on query time.

Package version

react-instantsearch-core 7.3.0

Operating system

No response

Browser

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@andretauffer andretauffer added the triage Issues to be categorized by the team label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issues to be categorized by the team
Projects
None yet
Development

No branches or pull requests

1 participant