0

Im using the drive api for python. We have this feature wherein the user is allowed to search for files inside the drive. We used the following parameters for the api. maxResults = 20 and q

        q = 'mimeType!="application/vnd.google-apps.folder" and fullText contains "%s" '

The query returned 3 pages. Page 1 - 20 results, Page 2 - 10 results, Page 3 - 4 results.

Is it really the behavior of the api? Or is it possible to have equal results per page?

Thank you.

jpv
  • 11
  • 1

1 Answers1

1

that has been, unfortunately, how the api has behaved since years ago.

the api applies some filters before (using their indexes and respecting page size) and some others (not supported by their indexes) after it has gotten results (the 20 elements page).

Ive even seen cases where the page is empty but still has a "next page" you need to keep getting.

Its a pain if you want to show an actual pagination to the user, or if you have time constrains as sometimes you need to get many pages just to get a few items, making the query very inneficient.

Zig Mandel
  • 19,571
  • 5
  • 26
  • 36
  • This is, sadly, the correct answer. I guess you're trying to do client pagination of the results. You're gonna have to fetch all the results and then do your own pagination. – pinoyyid Dec 02 '15 at 18:14