Skip to main content
Question

Search crashed during dynamic offset/limit

  • May 22, 2025
  • 1 reply
  • 17 views

Forum|alt.badge.img

Because Box doesn't support search by multiple metadata templates i forced to do a several call of the search api:

  1. Search for TEMPLATE_A.FIELD_A = XXX with limit 10
  2. When the page isn't filled with the result i do extra call for TEMPLATE_B.FIELD_B = XXX with limit = 10 - search1.entries.length

So:

Page1:
searchA({ offset: 0, limit: 10 }) -> return 6 records
searchB({ offset: 0, limit: 4 }) -> return 4 records = total 10

Page2:
searchB({ offset: 4, limit: 10 }) -> should return 10 records, but return an error

but the searchB({ offset: 4, limit: 10 }) throw an error: "UnhandledPromiseRejectionWarning: Error: Unexpected API Response [400 Bad Request | fzwuajh3a6k4akwd.067bf6953bfeeefdd8cafb43830054e6c] bad_request - Bad Request"

 

 

1 reply

Forum|alt.badge.img

Hi there, 

Welcome to the Box Community!

I have created a ticket for you since this issue should be best addressed by our Product Support. Kindly check your Inbox for updates. 

Thanks!