making a search.php query

You are missing the search parameter in your arguments. The code below, when added to the array in $the_query, should pass along the query string variable from a search:

's' => $s

Documentation is available here:
https://codex.wordpress.org/Class_Reference/WP_Query#Search_Parameter