We’re pleased to announce the release of 4 features added to our Bing offers on Azure DataMarket. These enhancements may look familiar to those who have applications built with the legacy API 2.0 service. The following features are now available in the Bing API and Bing API Web Only offers:
- “Options” search request parameter
- Multiple filtering support
- Composite Metadata
“Options” new optional search request parameter
This optional parameter enables partners to pass a string of search options like “EnableHighlighting”. Specifying this option means that Bing will use a special character to identify the beginning and the end of a query term that appears in results. Bing uses special characters to identify the beginning and the end of a query term that appears in results. These characters are E000 and E001, respectively. This capability is supported in the Web, News & Related Search data sources only.
Multiple filtering support
Both image and video data sources now support multiple filters on the request. For instance, to filter images by size, color and style, you can pass the value “Size:Medium+Color:Color+Style:Photo” in a request to the image data source.
Metadata refers to Bing API data that are applicable to all the results returned. For instance, metadata includes the estimated total results from which the Bing API returned results from. Other data returned include the altered query. This is helpful for the scenario where your application wants to present an “Are you looking for…” link if end-users to your app misspelled a query term. Accessing metadata is found in the content section of queries to the Composite service operation. Composite service operations are new to the Bing API Web only offer. It provides web results in the upper <link> section and metadata in the <content> section of the Bing API results.
To review the schema changes representing these enhancements, please visit the Bing API offers schema definitions.
Bing Search API
Bing Search API Web Only
Lester Jackson – Bing API Program Management
Not yet support consultation with the parameters Width and Heigth to imagefilters, as if he allowed the old version of the API
Example query on the old API
You need to look for a property called WebTotal. In XML, you can retrieve it as follows:
The equivalent for JSON is as follows:
Notice you must have the following specified in your request URL
In json, this info is at the beginning of the response (compliant with OData json format…). See the snippet of JSON response below where the WebTotal property is highlighted:
Remove the [ ] characters from your filter options. For instance, use the following:
...which maps to size:width:200+size:height:400
I have implemented a Composite Bing Search on my site and I'm pulling WebTotal to display the number of results found on the search, but I have noticed that as I walk through the results (10 at a time, using $skip and $top parameters) the WebTotal changes. Is there some way to get a stable number that doesn't change every time I skip to the next results?
There ae many properties outside of the Bing offers that govern the number of results returned. These aren't controlled by the API and are subject to change. Therefore, the Web Total indicator returned is specific to the query at the time the query was made.