I am using Bing Sharp 2.0. I would like to search for images by filters, so I follow the codes in the sample:
SearchRequest searchRequest = new SearchRequest { AppId = appId, Query = query, Market = "en-US" };
ImageRequest imageRequest = new ImageRequest();
imageRequest.Filters = buildFilterArray();
imageRequest.Count = imageCount;
imageRequest.Offset = (imageCount * pageNumber);
ImageResponse response = API.Image(searchRequest, imageRequest);
And this is buildFilterArray:
private string[] BuildFilterArray()
{
List<string> filters = new List<string>();
filters.Add("Size:Small");
filters.Add("Size:Medium");
return filters.ToArray();
}
But the result does not return anything (response.Total == 0).
I found the reason because I defined 2 filters in buildFilterArray (), while I delete one (no matter which), my search returns with the expected results.
This is also confirmed by issuing an HTTP request directly from IE, this returns the results:
http:
So far this is not:
http:
Am I doing something wrong? How can I put multiple filters in a search query?
source
share