Send logged in users to another search form from Search Block

I have two search forms.

A public Google CSE and a form only available to users currently logged in.

When a user is logged in and uses the Search Block, I want him to be sent to the internal search instead of the public default search.

function MYTHEME_form_search_block_form_alter(&$form, &$form_state, $form_id) {

    if (!Drupal::currentUser()->isAuthenticated()) {
        return;
    }

    $form['name']['#id'] = 'content_exclude';
    $form['#action'] = str_replace('/search/content', '/search/node', $form['#action']);

}

This works so far but doesn’t seem right.

I also need to set some default values only existing in the internal searchs “advanced” section which won’t work using my current approach.

Thank you!

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/4/feed