How to exclude pages from WP search based on page title

You can query a list of post IDs using $wpdb based on their slugs, and then use that in your filter. Here’s a simple example of how to do this:

function mm_search_filter( $query ) {

    // We will query a list of post IDs 
    // by using $wpdb
    global $wpdb;
    $post_ids = $wpdb->get_results("SELECT ID FROM wp_posts WHERE post_name IN 'download-'");

    // Now, pass the array of post IDs in
    if ( 
        ! $query->is_admin && 
        $query->is_search && 
        $query->is_main_query() && 
        ! empty ( $post_ids )
    ) {
        $query->set( 'post__not_in', $post_ids );
    }
}
add_action( 'pre_get_posts', 'mm_search_filter' );