def METHOD_NAME(resp):
    results = []
    resp_json = loads(resp.text)
    if 'error' in resp_json:
        raise SearxEngineAPIException(resp_json['error'])
    for result in resp_json['hits']['hits']:
        r = {key: str(value) if not key.startswith('_') else value for key, value in result['_source'].items()}
        r['template'] = 'key-value.html'
        if show_metadata:
            r['metadata'] = {'index': result['_index'], 'id': result['_id'], 'score': result['_score']}
        results.append(r)
    return results