Customize search_filter($query) function

OK.
I have changed $query->set(‘orderby’, ‘type’)

function search_filter($query) {
     if ($query->is_search && !is_admin()) {
         $query->set('post_type', array('post','forums'));
         $query->set('category_name', 'my-zen');
         $query->set('orderby', 'date');
         $query->set('order', 'ASC');
            
        }
        return $query;
    }
add_filter('pre_get_posts','search_filter');

Now, I don’t have any Error critical, but it doesn’t work. What is wrong in my code?

tech