Keep query string in url after executing a serch

It’s hard to say how to do it exactly in your case, because we don’t know how your form is generated… But in general you have to add a hidden input to that form.

So if you use searchform.php in your theme, then add something like this to it:

<input type="hidden" name="name" value="<?php echo esc_attr( $_GET['name'] ); ?>" />

If there is no searchform.php template in your theme and you’re using get_search_form function, then you’ll have to use a filter like this:

function add_custom_name_to_search_form( $form ) {
    $field = '<input type="hidden" name="name" value="'. esc_attr( $_GET['name'] ) .'" />'
    return str_replace( '</form>', $field . '</form>', $form );
}
add_filter( 'get_search_form', 'add_custom_name_to_search_form' );

But… My approach would be a little bit different… If user comes with some param in URL and I want to use this param during his visit on page, I store that value in a cookie…

function process_name_cookie() {
    if ( isset($_GET['name']) ) {
        setcookie( 'myname', $_GET['name'], 0, "https://wordpress.stackexchange.com/" );
    }
}
add_action( 'wp', 'process_name_cookie' );

And then you can use that cookie, so you don’t have to modify any link or forms.