using twitterCtx.Search doesn't give all results

Feb 28, 2013 at 9:09 PM
Edited Feb 28, 2013 at 9:10 PM
I have a simple query using twitterCtx.Search
(from search in twitterCtx.Search
     where search.Type == SearchType.Search && search.ResultType == ResultType.Recent &&
     search.Query == "MySearchQuery" && search.PageSize==100
     select search.Statuses).SingleOrDefault().Where(a=>a.User.Identifier.ScreenName !="MySearchQuery")
    .ToList();
For some reason it returns only 11 records, before the SingleOrDefault, After the SingleOrDefalt it returns 3 records, even if I remove all there where's it still returns 11 records. I want it to be filtered at most then bring me at least 100 that met that condition, but it doesn't
Coordinator
Feb 28, 2013 at 9:18 PM
Hi,

SingleOrDefault returns results from Twitter. Then your where clause filters on what was returned. The Searching Twitter documentation identifies what parameters you can use when querying Twitter, which are based on what Twitter allows. There's a link to the Twitter documentation at the bottom of the Searching Twitter page.

@JoeMayo
Feb 28, 2013 at 10:18 PM
I just changed the query to a simple
(from search in twitterCtx.Search
                                     where search.Type == SearchType.Search && search.ResultType == ResultType.Recent &&
                         search.Query == "Twitter" && search.PageSize == 100

                                     select search.Statuses)
Still the same issue, it does not return a 100 records, only 15. Its definitely more than 15 results that come from twitter. In your example you sent you have a Count property but their is no Count property on the search object in the dll that I am using
Feb 28, 2013 at 10:25 PM
I figured it out, the api version I had was old. But how do I filter out my search to include the ending part
 "SingleOrDefault().Where(a=>a.User.Identifier.ScreenName !="MySearchQuery")" 
without filtering more after results returned? I basically want that to be added in the api call not filtered after the api call
Coordinator
Feb 28, 2013 at 10:34 PM
The Twitter docs, Using the Search API, have several options for their queries. You might try something like this:
... search.Query == "Twitter AND from:MySearchQuery" ...
The RawResult property on your TwitterContext instance will show exactly what Twitter returned or you can see the Twitter response via Fiddler.

You can also compare results against what Twitter Search provides and tweak your search query.

@JoeMayo