def METHOD_NAME(self, result, doc_wrapper, facet_wrapper):
    response = result['response']
    doc_wrapper = doc_wrapper or web.storage
    facet_wrapper = facet_wrapper or (
        lambda name, value, count: web.storage(locals())
    )
    d = web.storage()
    d.num_found = response['numFound']
    d.docs = [doc_wrapper(doc) for doc in response['docs']]
    if 'facet_counts' in result:
        d.facets = {}
        for k, v in result['facet_counts']['facet_fields'].items():
            d.facets[k] = [
                facet_wrapper(k, value, count) for value, count in web.group(v, 2)
            ]
    if 'highlighting' in result:
        d.highlighting = result['highlighting']
    if 'spellcheck' in result:
        d.spellcheck = result['spellcheck']
    return d