Bings Search API always returns the same 10 results

Posted by Dofs on Stack Overflow See other posts from Stack Overflow or by Dofs
Published on 2011-11-19T09:29:10Z Indexed on 2011/11/19 9:51 UTC
Read the original article Hit count: 194

Filed under:
|

I am trying to figure Bings Seach API out. I have added the SOAP service to my solution, and I do receive results. The issue, is that the displayed results are always the same, not matter what I have set the request.Web to. When I do the search, it displays 98 results, so it isn't the lack of results.

        BingService soapClient = new BingService();

        string resp = string.Empty;
        SearchRequest request = new SearchRequest();
        request.AppId = ConfigurationManager.AppSettings["BingKey"];
        request.Sources = new BingLiveSearchService.SourceType[] { SourceType.Web };
        request.Query = query;
        request.Web = new BingLiveSearchService.WebRequest { Count = 10, Offset = 10 };

        var response = soapClient.Search(request);
        if (response.Web != null && response.Web.Total > 0)
        {
            resp += "TOTAL COUNT:"+response.Web.Total +"<br/><br />";
            foreach (var item in response.Web.Results)
            {
                resp += "<div style='padding-bottom:10px;'>" + item.Title + "</div>";
            }

        }

© Stack Overflow or respective owner

Related posts about c#

Related posts about bing-api