Marco72463


I have noticed that I cannot get more than 50 results back. Is this a new limit

I am using the SourceRequest.Count = 1000 and 9 come back. Any number up to 50 works but anything over 50 only brings in 9 records.

Am I doing something wrong

Thanks.

 





Re: MSN Search Web Service SDK Version 0.60 Now Available

James Gordon


Hi Marco, thanks for your continued use of the MSN Search Web Service API and your thoughtful questions in the forum. The limit that you ran into has been present since our launch and the behavior is as expected. Count has an upper limit of 50 and specifies the number of results per page. A requested value for Count of greater than 50 results causes the service to reset the Count to the default of 10 results per page.

The Count and Offset values are designed to be used together to provide up to 250 total results, so anytime Count + Offset is greater than 250, the service returns the last group of results beginning with Offset (if Offset is less than 250) and ending with the 250th result.

The behavior when the requested Offset is greater than or equal to 250 is a little more complicated; the service generally returns the last n results (where n = Count) for values of Count between 1 and 10 or the last 10 results (i.e. 240-250) when Count is greater than 10.

Although Offset accepts values in the range 1 to 1000, for the non-commercial use of the service, which returns a maximum of 250 results, this limit is effectively 250.

As for your result set containing 9 results rather than 10, this is likely an effect of duplication removal by the search engine.

I hope this clears things up a bit. The sample applications are designed to enable you to test different Counts, Offsets, and other settings in an easy-to-use format and you can use these to confirm the behavior of the service for different conditions. For additional information about the use of the Count and Offset fields, please see the online help at

http://msdn.microsoft.com/library/default.asp url=/library/en-us/msn_search_web_service_sdk/html/introducingthemsnsearchwebservice.asp.







Re: MSN Search Web Service SDK Version 0.60 Now Available

kerber

hi! i'm newbie c#.net.. and iam suffering of this sourcerequest count property..

pls see my sapmle code:

ctr=10;

MSNSearchService s = new MSNSearchService();

SearchRequest searchRequest = new SearchRequest();

int arraySize = 1;

SourceRequest[] sr = new SourceRequest[arraySize];

searchRequest.AppID = "B52E036970BE77BC6F9E33123E4C3DC5F58B91F5";

sr[0] = new SourceRequest();

sr[0].Source = SourceType.Web;

sr[0].ResultFields = ResultFieldMask.All;

sr[0].Count = 11;

sr[0].FileType = "doc";

sr[0].Offset = ctr;

searchRequest.Query = TextBox1.Text;

searchRequest.Requests = sr;

searchRequest.CultureInfo = "en-US";

SearchResponse searchResponse;

searchResponse = s.Search(searchRequest);

t1.Columns.Add("TITLE", Type.GetType("System.String"));

t1.Columns.Add("URL", Type.GetType("System.String"));

foreach (SourceResponse sourceResponse in searchResponse.Responses)

{

Result[] sourceResults = sourceResponse.Results;

//foreach (Result res in sourceResults)

//{

// insertData(editText(res.Title.ToString()), editText(res.Url.ToString()));

//}

if (sourceResponse.Total > 0)

{

Label1.Text = sourceResponse.Source.ToString() + " - Total Results: " + sourceResponse.Total.ToString();

}

DataGrid1.DataSource = sourceResults;

DataGrid1.DataBind();

}

//DataGrid1.DataSource = getData();

//DataGrid1.DataBind();

ctr += 11;

note: everytime i click next the number paging in my datagrid does not increase, in my thought it replace the previous data, is there a way to get all source request in just one query not limitting the count

tnx in advance..






Re: MSN Search Web Service SDK Version 0.60 Now Available

Vishal Batghare

Hi,

The link with different samples does not work.
How do i get more than 50 results in one go. Or we need to loop using offset and index If so can you tell me how

Regards,
VB