caroalvarezsilva / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

Getting documents..only first 100 will work (solution found) #464

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. DocumentsService.Query won't accept "start-index" nor "max-results".

They are ignored anyway by requests to http://docs.google.com (always the first 
100 documents returned) so its useless to add programmatic support to 
DocumentsListQuery.

2. DocumentsListQuery doesn't support the "start-key" parameter which is 
returned in DocumentsFeed.NextChunk; this one is supported by Google servers.

Solution:
I added the "start-key" case in DocumentsQuery.ParseUri/CalculateUri and it 
works: with a do/while (DocumentsFeed.NextChunk!=null) cycle I get all results.

I wanted to commit my documentquery.cs (attached) but it seems I'm not allowed 
to do it with SVN...if you need my support I will be pleased to.

Cheers,
Angelo

Original issue reported on code.google.com by angelo.a...@gmail.com on 2 Jan 2011 at 9:28

Attachments:

GoogleCodeExporter commented 8 years ago
Hey Angelo,

Is it that you want to page through all the document entries (more than 100) 
using the Service.Query method, or do you just want to get the next 100 entries 
starting at a specified key?  

When I page through entries using Service.Query, I use the "next" link in the 
document feed (i.e. documentFeed.AtomFeed.Links.FindService("next", 
Nothing).HRef.ToString)   

There is also an AutoPaging property in the Feed Class (defaults to false). In 
vb, it would look something like this (I think):

Dim documentsFeed As New Google.GData.Client.Feed(Of 
Google.Documents.Document)(documentsService, docsQuery) With {.AutoPaging = 
True} 

Would the above satisfy your needs?

Original comment by ed...@edwinlandy.com on 3 Jan 2011 at 8:14

GoogleCodeExporter commented 8 years ago

Original comment by ccherub...@google.com on 7 Feb 2011 at 1:38