cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you interested in hearing how one of our Community members uses Dropbox for sailing trips? Read all about it here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: Search Folder or File with SearchV2Async

Search Folder or File with SearchV2Async

ChandanT
New member | Level 2

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);

 

1 Reply 1

kylea
Dropbox 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?
Need more support?