'Returns a list of results from Flickr for the given query.
Retrieving the URL of a result (i.e. image) requires an additional query.
- type : SEARCH, IMAGE,
- start: maximum undefined,
- count: maximum 500,
- sort : RELEVANCY, LATEST or INTERESTING.
There is no daily limit.'

def search(self, query, type=IMAGE, start=1, count=10, sort=RELEVANCY, size=None, cached=True, **kwargs):

    if (type not in (SEARCH, IMAGE)):
        raise SearchEngineTypeError
    if ((not query) or (count < 1) or (start < 1) or (start > (500 / count))):
        return Results(FLICKR, query, IMAGE)
    url = (FLICKR + '?')
    url = URL(url, method=GET, query={'api_key': (self.license or ''), 'method': 'flickr.photos.search', 'text': query.replace('    ', '_'), 'page': start, 'per_page': min(count, 500), 'sort': {RELEVANCY: 'relevance', LATEST: 'date-posted-desc', INTERESTING: 'interestingness-desc'}.get(sort)})
    if (kwargs.get('copyright', True) is False):
        url.query['license'] = '5,7'
    kwargs.setdefault('unicode', True)
    kwargs.setdefault('throttle', self.throttle)
    data = url.download(cached=cached, **kwargs)
    data = xml.dom.minidom.parseString(bytestring(data))
    results = Results(FLICKR, query, IMAGE)
    results.total = int(data.getElementsByTagName('photos')[0].getAttribute('total'))
    for x in data.getElementsByTagName('photo'):
        r = FlickrResult(url=None)
        r.__dict__['_id'] = x.getAttribute('id')
        r.__dict__['_size'] = size
        r.__dict__['_license'] = self.license
        r.__dict__['_throttle'] = self.throttle
        r.text = self.format(x.getAttribute('title'))
        r.author = self.format(x.getAttribute('owner'))
        results.append(r)
    return results
