Search Data

Catalyst Search enables you to search and retrieve data records from the Catalyst Data Store. You can execute a search query using the execute_search_query() method to search for a particular pattern of data.

Create a Dictionary

The following code snippet creates a dictionary that contains the attributes of the pattern to be searched for, in the indexed columns of the individual Data Store tables.

    
copy
#Create a dictionary
config = {
'search': 'burrows*',
'search_table_columns': {
'Employee': ['EmployeeID'],
'Users': ['Name']
}
}

Execute Search Query

The dictionary object created in the previous section is passed as a parameter to the execute_search_query() method, which returns the response. The search_service reference used below is already defined in the component instance page.

    
copy
#Execute Search query response_data = search_service.execute_search_query(config)

A sample response will be shown below :

    
copy
{
AlienCity: [
{
CREATORID: "2136000000006003",
MODIFIEDTIME: "2021-08-13 13:49:19:475",
CITYNAME: "Dallas",
CREATEDTIME: "2021-08-13 13:49:19:475",
ROWID: "2136000000008508"
}
]
}

Last Updated 2023-12-18 16:20:08 +0530 +0530

ON THIS PAGE
ACCESS THIS PAGE