Google Drive Api not returning results by descendi

2019-01-29 07:14发布

问题:

I am using Google Documents List API for searching within documents.
Searching on the google drive ui returns results with most number of occurences of words first. But with api it returns the results with last uploaded date first. This is the URL which i am using https://docs.google.com/feeds/default/private/full?q=search+term

I also tried with https://docs.google.com/feeds/default/private/full?q=search+term&desc=true but this gave the same results that we were getting earlier i.e. by last uploaded date first. Can someone guide me with what additional parameters i should be adding to the url

回答1:

You can use the orderBy query parameter to order the Documents List Feed by certain criteria:

  • last-modified: Default value, sort by last modified date.
  • last-accessed: sort by last accessed date.
  • title: sort by title (this is what you're looking for.
  • starred: sort documents by their "starred" attribute.