コード例 #1
0
def test_search_table():
    '''
    test search_table()
    '''

    result = du.search_table('locations')
    assert (result == 'client_loc_search')
コード例 #2
0
ファイル: search_data.py プロジェクト: bocoup/mlab-vis-api
    def get_basic_search_results(self, search_type, search_query):
        '''
        Provide basic search with no filtering logic.
        Basic search is based purely on bigtable prefix scans.
        '''
        table_name = du.search_table(search_type)
        table_config = get_table_config(self.table_configs, None, table_name)

        results = bt.scan_table(table_config, self.get_pool(),
                                prefix=search_query)
        return results
コード例 #3
0
    def get_basic_search_results(self, search_type, search_query):
        '''
        Provide basic search with no filtering logic.
        Basic search is based purely on bigtable prefix scans.
        '''
        table_name = du.search_table(search_type)
        table_config = get_table_config(self.table_configs, None, table_name)

        results = bt.scan_table(table_config,
                                self.get_pool(),
                                prefix=search_query)
        return results
コード例 #4
0
    def get_table_name(cls, search_type, search_filter):
        '''
        Returns name of table for provided search type.

        search_type = type of search.
        search_filter = optional filter we are searching within.
        '''
        if search_filter['type']:
            # its a list table we want
            return du.list_table(search_type, search_filter['type'])
        else:
            # its a search table we want
            return du.search_table(search_type)
コード例 #5
0
ファイル: search_data.py プロジェクト: bocoup/mlab-vis-api
    def get_table_name(cls, search_type, search_filter):
        '''
        Returns name of table for provided search type.

        search_type = type of search.
        search_filter = optional filter we are searching within.
        '''
        if search_filter['type']:
            # its a list table we want
            return du.list_table(search_type, search_filter['type'])
        else:
            # its a search table we want
            return du.search_table(search_type)