l.s.s.BingSearchService : class documentation

Part of lp.services.sitesearch View In Hierarchy

See ISearchService.

A search service that searches Bing for launchpad.net pages.

Method subscription_key The subscription key issued by Bing Custom Search.
Method custom_config_id The custom search instance as configured in Bing Custom Search.
Method site The URL to the Bing Custom Search service.
Method search See ISearchService.
Method create_search_url Return a Bing Custom Search search url.
Method create_search_headers Return a dict with Bing Custom Search compatible request headers.
Method _checkParameter Check that a parameter value is not None or an empty string.
Method _parse_search_response Return a PageMatches object.
@property
def subscription_key(self):
The subscription key issued by Bing Custom Search.
@property
def custom_config_id(self):
The custom search instance as configured in Bing Custom Search.
@property
def site(self):
The URL to the Bing Custom Search service.

The URL is probably https://api.cognitive.microsoft.com/bingcustomsearch/v7.0/search.

def search(self, terms, start=0):
See ISearchService.

The subscription_key and custom_config_id are used in the search request. Search returns 20 or fewer results for each query. For terms that match more than 20 results, the start param can be used over multiple queries to get successive sets of results.

ReturnsISearchResults (PageMatches).
RaisesSiteSearchResponseError if the json response is incomplete or cannot be parsed.
def _checkParameter(self, name, value, is_int=False):
Check that a parameter value is not None or an empty string.
def create_search_url(self, terms, start=0):
Return a Bing Custom Search search url.
def create_search_headers(self):
Return a dict with Bing Custom Search compatible request headers.
def _parse_search_response(self, bing_json, start=0):
Return a PageMatches object.
Parametersbing_jsonA string containing Bing Custom Search API v7 JSON.
ReturnsISearchResults (PageMatches).
RaisesSiteSearchResponseError if the json response is incomplete or cannot be parsed.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.