fmccown


If I use the Live API to search for regular Web results (SourceType.Web) using 'site:foo.org' I can get a list of all URLs that are indexed from foo.org. But if I request only images (SourceType.Image) using the same query, I get back no results. Is this functionality broken, or am I doing something wrong

Code Snippet

MSNSearchService s = new MSNSearchService();
SearchRequest searchRequest = new SearchRequest();
int arraySize = 1;
SourceRequest[] sr = new SourceRequest[arraySize];

sr[0] = new SourceRequest();
sr[0].Source = SourceType.Image;

searchRequest.Query = "site:www.harding.edu";
searchRequest.Requests = sr;
searchRequest.AppID = "[MYID]";
searchRequest.CultureInfo = "en-US";
SearchResponse searchResponse = s.Search(searchRequest);

foreach (SourceResponse sourceResponse in searchResponse.Responses)
{
Result[] sourceResults = sourceResponse.Results;
if (sourceResponse.Total == 0)
{

// Gets printed no matter white site I use

Console.WriteLine("No results were returned");
}

// etc...
}



Thanks,
Frank



Re: Image search with 'site:' operator

Nate Buggia - MSFT


Try adding a space between the site: and the domain name, like below:

Code Snippet

searchRequest.Query = "site: www.harding.edu";

One of the silly idiosyncrasies of our query language Smile

regards,

nate







Re: Image search with 'site:' operator

fmccown

Thanks for the reply, Nate. If I use a space ("site: www.harding.edu") using the API, I get 2 results. I get the same 2 results using the exact same query from the web interface:

http://search.live.com/images/results.aspx q=site%3A%20www.harding.edu

But if I just use ("site:www.harding.edu") without the space on the web interface, I get over 1000 results:

http://search.live.com/images/results.aspx q=site%3Awww.harding.edu

It's these 1000+ results that I'd like to get with the API. So do you think you guys could fix this little problem

Thanks,
Frank







Re: Image search with 'site:' operator

Yu-Ting Kuo - MSFT

site: with and without a space between colon and domain name are interpreted differently and will have different results in most cases. e.g. site:www.microsoft.com in image search will give you images from www.microsoft.com however site: www.microsoft.com will return images from other sites as well.

in this case it is potentially a bug as the SOAP API shouldn't return zero result given you are able to get some image search results on live.com for the same query but we have to do some further investigation why it behaves this way.

thank you very much for bringing this to our attention.





Re: Image search with 'site:' operator

fmccown

Thank you for taking the time to look into this problem. I would really like to use your service once this issue is resolved.