how to display custom search results

I am using a custom form, which queries a custom table. The form is displayed with a custom template. Since, that is the case, search.php isn't the default template being used to display search results of my custom form. Instead, index.php is being used. I have created a custom template to display results, but how do I get wp to use it?
The code:

used resources:
( )