':param FriendlySearchQuery query:
:return:'

def search(self, query):

    client_query = self.friendly_query_to_client_query(query)
    json_results = self.rest_client.search(client_query)
    json_torrents = json_results.get(u'torrents', [])
    json_not_pending_torrents = [x for x in json_torrents if (not isinstance(x, int))]
    log.debug(u"Search    produces    %d    results    including    %d    'on    pending'    (the    latter    will    not    produces    entries)", len(json_torrents), (len(json_torrents) - len(json_not_pending_torrents)))
    download_auth = T411BindAuth(self.rest_client.api_token)
    map_function = partial(T411ObjectMapper.map_search_result_entry, download_auth=download_auth)
    return list(map(map_function, json_not_pending_torrents))
