WordPress custom search by post type

Yes, it is possible. You will have to use your custom SQL query though.

Use posts_where filter to modify the query.

function posts_where( $where ) {
    if( !is_admin() ) {
        $where = <YOUR CONDITION>;
    }
    return $where;
}
add_filter( 'posts_where' , 'posts_where' );

Your condition should look something like this:

post_status="publish" AND ((post_type="post" AND post_title LIKE <QUERY>) OR (post_type="page" AND post_content LIKE <QUERY>))

You should also make sure, that you will modify only main query and not all of them. You can add filter just before main query (i.e. using pre_get_posts action) and remove it just after or even inside this filter, I guess.