Vik
Vik

Reputation: 9289

google drive api partial search results

I am using Google Drive API from Google App engine for java. I am searching the google docs with search string

Files.List request = service.files().list().setQ("title contains 'Donation'");

It returns only 2 files with title DonationThankYouLetterData and How to Create Awareness on Blood Donation

I failed to understand why it is not returning other files with title like DonationThankYou_Anil Kumar _02-Aug-2013 Donation

All files are created by me so owner is same.

Upvotes: 0

Views: 311

Answers (1)

pinoyyid
pinoyyid

Reputation: 22296

It could be a number of reasons...

  1. Is there a nextPage link that you should be following. Drive doesn't guarantee to return all hits in a single response
  2. Do you have the correct scope to access the file. Eg. if the first two files were created by your app, and the third was created in Drive, and your app only has drive.file scope.

To investigate further, you should ...

  1. Go to https://developers.google.com/drive/v2/reference/files/get and retrieve the item for each file. Compare them to see if there is any obvious difference
  2. Run the list without the query to confirm that all three files are indeed being returned

Also look at this answer Drive API files.list query with 'not' parameter returns empty pages which seems to suggest that "contains" is broken, but that doesn't seem to match your symptoms, based on the file names you used in your question.

Upvotes: 1

Related Questions