<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Free For All</title><link>http://forums.asp.net/12.aspx</link><description>Unmoderated open discussions for anything concerning Microsoft .NET and related technologies.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Getting different total number of search results for Live search integration</title><link>http://forums.asp.net/thread/3273380.aspx</link><pubDate>Fri, 03 Jul 2009 11:20:38 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273380</guid><dc:creator>vickyp</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273380.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=12&amp;PostID=3273380</wfw:commentRss><description>&lt;p&gt;&lt;span&gt;Hi,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;br /&gt;I integrated Live Search to a website&lt;br /&gt;Problem: Following code returning different total number of search results for different value of sr[0].Offset&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;br /&gt;Example:&lt;br /&gt;sr[0].Offset = 0 then getting &amp;nbsp;totalResults = 260 &lt;br /&gt;When I changed value of sr[0].Offset = 50 then getting totalResults = 52&lt;br /&gt;here &amp;nbsp;totalResults is total number of search results&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MSNSearchService s = new MSNSearchService();&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SearchRequest searchRequest = new SearchRequest();&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SourceRequest[] sr = new SourceRequest[1];&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sr[0] = new SourceRequest();&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sr[0].Source = SourceType.Web;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sr[0].ResultFields = ResultFieldMask.All;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sr[0].Count = 10; // max results that can be returned in one query is 50&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sr[0].Offset = 0;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; searchRequest.Query = &amp;quot;hyderabad site:&lt;a rel="nofollow" href="http://www.microsoft.com/india/msidc" target="_blank"&gt;www.microsoft.com/india/msidc&lt;/a&gt;&amp;quot;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; searchRequest.Requests = sr;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; searchRequest.AppID = &amp;quot;B5943503F4A9F59F96AB909512DDDCD503E52568&amp;quot;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; searchRequest.CultureInfo = &amp;quot;en-US&amp;quot;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; searchRequest.SafeSearch = SafeSearchOptions.Moderate;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; searchRequest.Flags = SearchFlags.DisableHostCollapsing&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | SearchFlags.DisableSpellCorrectForSpecialWords | SearchFlags.MarkQueryWords;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SearchResponse searchResponse = s.Search(searchRequest);&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // demonstrate how to get the total number of search results&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int totalResults = searchResponse.Responses[0].Total;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(totalResults);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;</description></item></channel></rss>