Page size not working?

Oct 10, 2012 at 9:40 AM

Hi Joe,

I'm using the following code to retrieve tweets.

       var sch =
                (
                    from search in twitterCtx.Search
                    where search.Type == SearchType.Search &&
                          search.Query == "apple" &&
                          search.IncludeEntities == true &&
                          search.PageSize == 100 &&
                          search.ShowUser == true
                    select search
                ).Single();

 

This works well, except that I cannot retrieve more than 15 statuses despite setting the PageSize to 100. Changing the Query still results in the same number of returned statuses.

Is this behaviour expected, or is there another property I need to set to increase the number of returned statuses?

Thanks

Oct 10, 2012 at 11:26 AM
Edited Oct 10, 2012 at 11:27 AM

I am having exactly the same problem with this piece of code:

 

var queryResults =
                        (from search in twitterCtx.Search
                         where search.Type == SearchType.Search &&
                         search.ResultType == ResultType.Recent &&
                         search.Query == getSearchQuery()  &&
                         search.SearchLanguage == "en" &&
                         search.SinceID == maxId &&
                         search.PageSize == 75
                         select search);

                        numberOfActualRuns++;

                        foreach (Search s in queryResults)
                        {
                            

                            Console.WriteLine("aantal tweets: " + s.Statuses.Count);

 

I always get 15 or less statuses.

Coordinator
Oct 10, 2012 at 1:27 PM

Hi,

Paging is different and works on SinceID and MaxID for making sure you avoid duplicate tweets.  I've written a blog post on how to do this with status queries, but the technique should be applicable to searches as well:

http://geekswithblogs.net/WinAZ/archive/2012/09/02/working-with-timelines-with-linq-to-twitter.aspx

Joe

Oct 10, 2012 at 2:21 PM

Thanks Joe.

Looking at the Twitter documentation it would appear the default number of statuses returned is 15 for the search API, unless the 'count' property is specified. Could it be the PageSize property should be changed to count? The documentation says:

"The number of tweets to return per page, up to a maximum of 100. Defaults to 15. This was formerly the "rpp" parameter in the old Search API."

Thanks

Coordinator
Oct 10, 2012 at 11:27 PM

Totally agree. In fact, I made those changes to the source code recently - just haven't released yet.

Joe

Oct 11, 2012 at 3:53 PM

Thanks,

I have the exact same problem.

Is there any plans for then the next release will be released?

Tomas

Coordinator
Oct 12, 2012 at 1:17 AM

I plan to soon.  A work-around until then is to download the solution, available via the Source menu.

Joe