Custom search: Search posts but display parent page in results

Ok I have figured it out; added the following to functions.php:

add_filter( 'posts_request', 'my_request_filter', 10, 2 );

function my_request_filter($sql, $query) {
    if($query->is_main_query() && is_search()) {
        $sql = "SELECT * FROM wp_posts WHERE post_content LIKE '[smoothslider%' AND post_parent !='0'";
    }
    return $sql;
}

I understand that with no access to the database or being able to run test my slider it was only guessing so I’ll check your answer as accepted answer anyway.
Thank you for your help.