예제 #1
0
파일: views.py 프로젝트: CCLab/RS_ref
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 ))
예제 #2
0
파일: views.py 프로젝트: CCLab/RS_ref
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))
예제 #3
0
파일: rsdbapi.py 프로젝트: CCLab/RS_ref
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
예제 #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