Is there a secret switch to force the Google Drive SDK to search for a folder and its child folders?

I am building a Google Drive SDK application and will use search as part of the solution.

My goal is to be able to perform a full text search in the displayed folder, and the child folders with one call.

My initial (and naive) attempt at this only returned the results for the immediate parent specified in the query string (root in the example below)

"'root' in parents and fullText contains 'wire'" 

I had a deep dive into the api documentation and I can not find anything that could do this.

Google has a secret property that I can transfer that will allow this activity ... I cannot believe for a second that they would miss such an obvious use case!

If I cannot find a suitable option, I will have to get a list of the folders that make up the drive, and then do a full text search on the entire drive (this will return many other results than I need) and then filter locally on my application server to get the results folders that I want. This way reducing the number of API calls to 2 (1 if I cache the list of folders for a while)

Anyone's thoughts?

+7
c # google-drive-sdk
source share
1 answer

Instead of pulling out a list of all files and filtering them locally, you can pull out the list of folders (and subfolders) that you want to search (or cache them, as you said), and build your query to have something like ([FolderID1] in parents OR [FolderID2] in parents OR ... OR [FolderIDn] in parents) and fullText contains 'wire' .

0
source share

All Articles