You need to be reading the search parameter from the URL. By default WordPress uses the parameter s
to store the search results. So you’d need to do something like:
$user_search = ( isset( $_REQUEST['s'] ) ? '*' . wp_unslash( trim( $_REQUEST['s'] ) ) . '*' : false );
if ( false != $user_search ) {
$query->set('search', $user_search);
$query->set('search_columns', array( <comma separated list of any fields other than content you want searched> ));
}