Search Data in Indexed Columns
Search executes a searchQuery() method to search for a particular pattern of data. You can search:
- Data in multiple tables
- Only data in search indexed columns
To learn more about search please refer to the documentation here.
The following code snippet contains the pattern to search for in specified columns of the tables:
Ensure the following packages are imported:
copy
import com.zc.component.object.ZCRowObject;
import com.zc.component.search.ZCSearch;
import com.zc.component.search.ZCSearchDetails;
copy
//Get an instance of SearchDetails
ZCSearchDetails search = ZCSearchDetails.getInstance();
//Set the pattern to be searched
search.setSearch("Sa*");
//Create a hashmap for the tables and corresponding column lists to search
HashMap<String,List\*> map = new HashMap ();
List searchList1 = new ArrayList();
List searchList2 = new ArrayList();
//Add indexed columns of same or different tables to the list
searchList1.add("SearchIndexedColumn");
searchList2.add("SearchTest");
//Add the table with its name and the column lists
map.put("SampleTable", searchList1);
map.put("Users", searchList2);
//Set the table-column mapping for searching
search.setSearchTableColumns(map);
//Execute Search by passing the search instance with the details
ArrayList<ZCRowObject> rowList = ZCSearch.getInstance().executeSearchQuery(search);
Last Updated 2023-09-03 01:06:41 +0530 +0530
Yes
No
Send your feedback to us
Skip
Submit