cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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 all files using searchbuilder

Search all files using searchbuilder

Anil
Explorer | Level 4

I am trying to list all files in the folder using searchBuilder, when I passing the multiple extensions passing in Query which results Zero values. 

For Eg:

String query = ".pdf";
Long max = 100L;
Long stat = 0L;

SearchResult sresult;
SearchMode mode = SearchMode.FILENAME;
sresult = DropboxClient.getClient().files().searchBuilder(path, query).withMode(mode).withMaxResults(max).withStart(stat).start();
java.util.List<SearchMatch> res = sresult.getMatches();

Above code works fine for me, But i trying to multiple extensions ".pdf .jpg" it will not works.

Is any possible way to search all files with any maxmium limit?

5 Replies 5

Greg-DB
Dropbox Staff

The search functionality doesn't support searching for files with one or more of the search terms. It works by searching for all of them. We'll consider this a feature request.

 

Instead, you should either make multiple search calls, one per file type, or use listFolder and listFolderContinue to list all files in a given folder, and filter them as desired.

Anil
Explorer | Level 4

Thanks Greg for the QuickReply. Currently i am using ListFolder and it will take some if the folder has 10000 files or more. What i am trying to do is to load limited files for better UI experiences for eg: 100 and another set of 100 files only when user demands.  Is any options for listing files with limit in ListFolder API?

Greg-DB
Dropbox Staff
No, ListFolder doesn't allow you to configure the page size, but I'll be sure to pass this along as a feature request as well.

Anil
Explorer | Level 4

Thanks Greg for your support.

Greg-DB
Dropbox Staff

You can now set an approximate limit on the listFolder page size by using ListFolderBuilder.withLimit.

Need more support?