Search Results Customization

You can modify any query in pre_get_posts filter. So your code could looks like this:

function prefix_modify_search( $query ) {
    if( $query->is_search && $query->is_main_query() ) {
        $search = $query->get( 's' );
        $search .= '*';
        $query->set('s', $search);
    }
}
add_action( 'pre_get_posts', 'prefix_modify_search' );

Note that the query parameter is passed as reference so you don’t need to return it.