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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 400 when too much multi query #142

Open
AntoineDuComptoirDesPharmacies opened this issue Jun 16, 2023 · 0 comments
Open

Error 400 when too much multi query #142

AntoineDuComptoirDesPharmacies opened this issue Jun 16, 2023 · 0 comments

Comments

@AntoineDuComptoirDesPharmacies
Copy link

Description

When using useFrequentlyBoughtTogether with more than 50 objectIDs, we receive an error responde from Algolia.
{"message":"Too many queries in multi query request","status":400}

Reproduction

Its the basic codesandbox with the objectId sent 51 times instead of once.
https://codesandbox.io/s/dreamy-keldysh-rdwthn?file=/app.tsx

Steps

  1. Open dev tools to see network request
  2. Click on the select and choose an item
  3. See error 400 in recommendations request

Expected behavior

The hook should split objectIDs in multiple batch of 50 and send multiple query to Algolia, merge the result and send back.

Environment

  • OS: Windows 10
  • Browser: Chrome
  • Library version: 114
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

No branches or pull requests

1 participant