def search_count( req ): user_query = req.GET.get( 'user_query', None ) scope = json.loads( req.GET.get( 'scope', 'null' ) ) results = sqldb.search_count( user_query, scope ) return HttpResponse( json.dumps( results ))
def search_count(req): user_query = req.GET.get('user_query', None) scope = json.loads(req.GET.get('scope', 'null')) results = sqldb.search_count(user_query, scope) return HttpResponse(json.dumps(results))
def get_search_count( uri, endpoint, query ): if endpoint == 'all_endpoints': db_tree = sqldb.get_db_tree() endpoints = [ el['endpoint'] for el in db_tree if el['endpoint'] is not None ] else: endpoints = [ endpoint ] data = sqldb.search_count( query, endpoints ) for result in data: result['search_data_uri'] = create_search_uri( uri, result['endpoint'] ) return data
def get_search_count(uri, endpoint, query): if endpoint == 'all_endpoints': db_tree = sqldb.get_db_tree() endpoints = [ el['endpoint'] for el in db_tree if el['endpoint'] is not None ] else: endpoints = [endpoint] data = sqldb.search_count(query, endpoints) for result in data: result['search_data_uri'] = create_search_uri(uri, result['endpoint']) return data