We dont how your search method works or what type of object its expecting.
since you said you want to pass a string (or say other data type) to the search method you can use
method overloading[
^] in your application to accept different data types.
Construct the actual objects inside these overloaded methods and call the actual Search method from these overloads.