Skip to content

Conversation

@raed667
Copy link
Contributor

@raed667 raed667 commented Apr 7, 2025

Summary

When requesting multiple objectIDs, there is a chance that the merged results contains some of the input items.

We can filter those out for a more consistent output.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 7, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e9e523e:

Sandbox Source
example-instantsearch-getting-started Configuration
example-react-instantsearch-getting-started Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-react-instantsearch-next-routing-example Configuration
example-vue-instantsearch-getting-started Configuration

@Haroenv
Copy link
Contributor

Haroenv commented Apr 7, 2025

should this not be done backend? now the counts may be off

@raed667
Copy link
Contributor Author

raed667 commented Apr 7, 2025

@Haroenv

should this not be done backend

The backend doesn't have a concept of a query with multiple objectIDs, they're treated as separate independent queries.

For example: getFBT(['obj1', 'obj2'] will result in 2 different Recommend calls, with the risk that getFBT('obj1') returns a list of recommendations that include obj2 and vise-versa

@raed667 raed667 force-pushed the feat/recommend/filter-out-input-ids branch from 2ecf760 to 72b5abc Compare April 7, 2025 16:35
@raed667 raed667 marked this pull request as ready for review April 7, 2025 16:35
@raed667 raed667 requested review from a team, Haroenv, aymeric-giraudet and sarahdayan and removed request for a team April 7, 2025 16:36
Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unavoidable to do this frontend for now, but I'd like to see the multi query move backend

@raed667 raed667 changed the title feat(recommend): filter out input objectIDs feat(recommend): filter out input objectIDs [RECO-2436] Apr 8, 2025
@Haroenv Haroenv merged commit c737519 into master Apr 23, 2025
14 checks passed
@Haroenv Haroenv deleted the feat/recommend/filter-out-input-ids branch April 23, 2025 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants