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. The search_service reference used in the code snippet is the component instance.
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.
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"
}
]
}
Yes
No
Send your feedback to us
Skip
Submit