Exemplo n.º 1
0
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 ))
Exemplo n.º 2
0
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))
Exemplo n.º 3
0
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
Exemplo n.º 4
0
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