Open AntoineDuComptoirDesPharmacies opened 1 year ago
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}
useFrequentlyBoughtTogether
objectIDs
{"message":"Too many queries in multi query request","status":400}
Its the basic codesandbox with the objectId sent 51 times instead of once. https://codesandbox.io/s/dreamy-keldysh-rdwthn?file=/app.tsx
Steps
The hook should split objectIDs in multiple batch of 50 and send multiple query to Algolia, merge the result and send back.
Description
When using
useFrequentlyBoughtTogether
with more than 50objectIDs
, 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
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