How can I make a search form that can search taxonomies and posts?

I believe something like this would do the trick.

EDIT

My code assumes the querystring value is the post_type, not an integer like your form field. Also, your form field is named ‘cat’, I think WordPress has that reserved, at least I remember having conflicts when I last used ‘cat’ in a querystring.

EDIT 2

(Changed filter from ‘posts_where’ to ‘pre_get_posts’ after having done some tests)

In functions.php

 function my_filter( $query )
 {
      if( is_search() )
      {
           $type = ( !empty( $_GET['your-field'] ) ) ? $_GET['your-field'] : "";

           if( $type )
                $query->set( 'post_type', $type );
      }
 }
 add_filter( 'pre_get_posts', 'my_filter' );