You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

bb-jacin's avatar
bb-jacin
Explorer | Level 3
3 years ago

/files/search_v2 returning files that are not in the specified 'path'

Hi, I am experiencing an issue with API requests to /files/search_v2 (and /files_search) where files are being returned that are outside of the specified 'path' option that is being sent with the API request.

 

To explain my use case:

We have a directory /output. When files appear in this directory, we use the Dropbox endpoint /files/search_v2 to locate specific files and then use /files/move_batch_v2 to move them elsewhere in the Dropbox account. These files all share similar traits in their filename, for example they may all end in '-0000.jpg'.

 

When we perform a search using /files/search_v2, we may use the query "-0000.jpg" and supply the path "/output", which will return matching files in that directory, however it will also return matching files in other directories where we have moved files to.

 

Why is it that the 'path' option is being ignored in these requests? Is it something to do with some kind of caching on Dropbox's end?

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Yes, the search results are subject to delays and staleness due to indexing/caching, which can result in this behavior for moved files. This should automatically catch up after a short time.

     

    For more definitive results not subject to this, you may want to use /2/files/list_folder[/continue] instead.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,915 PostsLatest Activity: 7 hours ago
333 Following

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!