One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
johndoe5
5 years agoExplorer | Level 3
search_v2: has_more=true even though there're no more results
I have a directory a, with one sub directory, which contains another subdirectory. Each directory contains an image file with a ".jpg" extension (so three images in total).
When I create a search query for ".jpg" inside the folder a with max_results=3, I get a response with exactly three results. But has_more equals true. When I use the returned cursor in a request to /files/search/continue_v2, an empty result is returned with has_more=false.
I would expect the API to return has_more=false on the very first request, since there are no more results.
When I change the max_results parameter of the initial search request to 4, the response contains all (three) results and has_more=false.
Is this behaviour intended?
Hi johndoe5,
Since Dropbox API is asynchronous, if not explicitly pointed out something else for particular call, you can't rely on any particular result. Any possible result, described in documentation, is... possible! So you must not assume anything, but strictly follow the API description. At the point, you have described, possibly there wasn't enough time to ongoing procedure gets to the end and it assumes there are other entries (even though there are not). That's it.
Hope this clarifies matter.
- ЗдравкоLegendary | Level 20
Hi johndoe5,
Since Dropbox API is asynchronous, if not explicitly pointed out something else for particular call, you can't rely on any particular result. Any possible result, described in documentation, is... possible! So you must not assume anything, but strictly follow the API description. At the point, you have described, possibly there wasn't enough time to ongoing procedure gets to the end and it assumes there are other entries (even though there are not). That's it.
Hope this clarifies matter.
- Greg-DB
Dropbox Staff
johndoe5 Здравко is correct, the page size of a result from /2/files/search_v2 and /2/files/search/continue_v2 is not guaranteed, and may be empty in some cases like this, due to how the Dropbox search functionality works. Your app should be written to call back if 'has_more' is true, but be able to handle empty 'matches' lists.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,945 PostsLatest Activity: 3 minutes ago
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!