def _normalize_json_search_response(self, json):
        result = {}
        if u'response' in json:
            result['num_found'] = json[u'response'][u'numFound']
            result['max_score'] = float(json[u'response'][u'maxScore'])
            docs = []
            for doc in json[u'response'][u'docs']:
                resdoc = {}
                if u'_yz_rk' in doc:
                    # Is this a Riak 2.0 result?
                    resdoc = doc
                else:
                    # Riak Search 1.0 Legacy assumptions about format
                    resdoc[u'id'] = doc[u'id']
                    if u'fields' in doc:
                        for k, v in doc[u'fields'].iteritems():
                            resdoc[k] = v
                docs.append(resdoc)
            result['docs'] = docs
        return result
Copy the contents of this file to dstfilename.
dataset/ETHPy150Open basho/riak-python-client/riak/codecs/http.py/HttpCodec._normalize_json_search_response--crossover with--dataset/ETHPy150Open PyTables/PyTables/tables/file.py/File.copy_file