def get(self): '''Suggest organizations''' args = suggest_parser.parse_args() return [{ 'id': opt['payload']['id'], 'name': opt['text'], 'score': opt['score'], 'slug': opt['payload']['slug'], 'image_url': opt['payload']['image_url'], } for opt in search.suggest(args['q'], 'org_suggest', args['size'])]
def get(self): '''Suggest users''' args = suggest_parser.parse_args() return [{ 'id': opt['payload']['id'], 'fullname': opt['payload']['fullname'], 'avatar_url': opt['payload']['avatar_url'], 'slug': opt['payload']['slug'], 'score': opt['score'], } for opt in search.suggest(args['q'], 'user_suggest', args['size'])]
def get(self): '''Suggest reuses''' args = suggest_parser.parse_args() return [{ 'id': opt['text'], 'title': opt['payload']['title'], 'score': opt['score'], 'slug': opt['payload']['slug'], 'image_url': opt['payload']['image_url'], } for opt in search.suggest(args['q'], 'reuse_suggest', args['size'])]
def get(self): '''Suggest geospatial zones''' args = suggest_parser.parse_args() return [{ 'id': opt['text'], 'name': payload_name(opt['payload']), 'code': opt['payload']['code'], 'level': opt['payload']['level'], 'keys': opt['payload']['keys'], 'score': opt['score'], } for opt in search.suggest(args['q'], 'zone_suggest', args['size'])]
def get(self): '''Suggest datasets''' args = suggest_parser.parse_args() return [{ 'id': opt['payload']['id'], 'title': opt['text'], 'acronym': opt['payload'].get('acronym'), 'score': opt['score'], 'slug': opt['payload']['slug'], 'image_url': opt['payload']['image_url'], } for opt in search.suggest(args['q'], 'dataset_suggest', args['size']) ]
def get(self): '''Suggest territories''' args = suggest_parser.parse_args() return [{ 'id': opt['payload']['id'], 'name': opt['payload']['name'], 'code': opt['payload']['code'], 'level': opt['payload']['level'], 'keys': opt['payload']['keys'], 'score': opt['score'], } for opt in search.suggest(args['q'], 'territory_suggest', args['size'])]
def get(self): '''Suggest datasets''' args = suggest_parser.parse_args() return [ { 'id': opt['payload']['id'], 'title': opt['text'], 'score': opt['score'], 'slug': opt['payload']['slug'], 'image_url': opt['payload']['image_url'], } for opt in search.suggest(args['q'], 'dataset_suggest', args['size']) ]
def get(self): '''Suggest users''' args = suggest_parser.parse_args() return [ { 'id': opt['payload']['id'], 'fullname': opt['payload']['fullname'], 'avatar_url': opt['payload']['avatar_url'], 'slug': opt['payload']['slug'], 'score': opt['score'], } for opt in search.suggest(args['q'], 'user_suggest', args['size']) ]
def get(self): '''Suggest organizations''' args = suggest_parser.parse_args() return [ { 'id': opt['payload']['id'], 'name': opt['text'], 'score': opt['score'], 'slug': opt['payload']['slug'], 'image_url': opt['payload']['image_url'], } for opt in search.suggest(args['q'], 'org_suggest', args['size']) ]
def get(self): """Suggest users""" args = suggest_parser.parse_args() return [ { "id": opt["payload"]["id"], "fullname": opt["payload"]["fullname"], "avatar_url": opt["payload"]["avatar_url"], "slug": opt["payload"]["slug"], "score": opt["score"], } for opt in search.suggest(args["q"], "user_suggest", args["size"]) ]
def get(self): """Suggest organizations""" args = suggest_parser.parse_args() return [ { "id": opt["text"], "name": opt["payload"]["name"], "score": opt["score"], "slug": opt["payload"]["slug"], "acronym": opt["payload"]["acronym"], "image_url": opt["payload"]["image_url"], } for opt in search.suggest(args["q"], "org_suggest", args["size"]) ]
def get(self): '''Suggest geospatial zones''' args = suggest_parser.parse_args() return [ { 'id': opt['text'], 'name': opt['payload']['name'], 'code': opt['payload']['code'], 'level': opt['payload']['level'], 'keys': opt['payload']['keys'], 'score': opt['score'], } for opt in search.suggest(args['q'], 'zone_suggest', args['size']) ]
def get(self): '''Suggest territories''' args = suggest_parser.parse_args() return [ { 'id': opt['payload']['id'], 'name': opt['payload']['name'], 'code': opt['payload']['code'], 'level': opt['payload']['level'], 'keys': opt['payload']['keys'], 'score': opt['score'], } for opt in search.suggest(args['q'], 'territory_suggest', args['size']) ]
def get(self): '''Suggest file formats''' args = suggest_parser.parse_args() result = search.suggest(args['q'], 'format_suggest', args['size']) return sorted(result, key=lambda o: len(o['text']))
def get(self): '''Suggest tags''' args = parser.parse_args() q = normalize(args['q']) result = search.suggest(q, 'tag_suggest', args['size']) return sorted(result, key=lambda o: len(o['text']))
def get(self): """Suggest tags""" args = parser.parse_args() result = search.suggest(args["q"], "tag_suggest", args["size"]) return sorted(result, key=lambda o: len(o["text"]))