def results(self):
        '''Returns results as a JSON encodable Python value.

        This calls :meth:`SearchEngine.recommendations` and converts
        the results returned into JSON encodable values. Namely,
        feature collections are slimmed down to only features that
        are useful to an end-user.
        '''
        results = self.recommendations()
        transformed = []
        for t in results['results']:
            if len(t) == 2:
                cid, fc = t
                info = {}
            elif len(t) == 3:
                cid, fc, info = t
            else:
                bottle.abort(500, 'Invalid search result: "%r"' % t)
            result = info
            result['content_id'] = cid
            if not self.params['omit_fc']:
                result['fc'] = util.fc_to_json(fc)
            transformed.append(result)
        results['results'] = transformed
        return results
def results ( self ) : results = self . recommendations ( ) transformed = [ ] for t in results [ 'results' ] : if len ( t ) == 2 : cid , fc = t info = { } elif len ( t ) == 3 : cid , fc , info = t else : bottle . abort ( 500 , 'Invalid search result: "%r"' % t ) result = info result [ 'content_id' ] = cid if not self . params [ 'omit_fc' ] : result [ 'fc' ] = util . fc_to_json ( fc ) transformed . append ( result ) results [ 'results' ] = transformed return results
Returns results as a JSON encodable Python value.

        This calls :meth:`SearchEngine.recommendations` and converts
        the results returned into JSON encodable values. Namely,
        feature collections are slimmed down to only features that
        are useful to an end-user.