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

ChandanT's avatar
ChandanT
New member | Level 2
3 years ago

Search Folder or File with SearchV2Async

Hi,

 

I am trying to search for a specific folder in Dropbox using `Files.SearchV2Async` function in Dropbox sdk.

The search option is set to look for only the active files/folders, but with this option set `Files.SearchV2Async` returns even the deleted folder (the result for the deleted folder has IsDeleted flag as false, while I expected this to be true).

Am I missing anything here?

 

SearchOptions options = new SearchOptions(path,
    fileStatus: status.AsActive,
    filenameOnly: searchFiles);

var res = await _client.Files.SearchV2Async(query, options);

var matchesToConsider = res.Matches?.Where(x => !x.Metadata.AsMetadata.Value.IsDeleted);

 

  • kylea's avatar
    kylea
    Icon for Dropbox Staff rankDropbox Staff

    To confirm, you're observing (1) that the search endpoint is returning a deleted folder when you specify active content only, and (2) that the returned search result also reporting that it is not deleted?

     

    I'm not able to reproduce that behavior. A couple questions:

    • How are you sure that the deleted folder is actually deleted? Is it possible you have similarly named folders?  I would look to compare the result of files/get_metadata with the search result's metadata to ensure we have the same path / id / status.
    • Is it possible that you deleted the folder at almost the same time as the search?
    • Are you able to reproduce this outside of the SDK (like in our API explorer) or is it specific to the SDK?  If the later, which version are you on?

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,918 PostsLatest Activity: 2 days ago
334 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!