Index: wp-includes/query.php
===================================================================
--- wp-includes/query.php	(revision 18064)
+++ wp-includes/query.php	(working copy)
@@ -2374,10 +2374,13 @@
 		}
 
 		$exclude_post_types = '';
-		$in_search_post_types = get_post_types( array('exclude_from_search' => false) );
-		if ( ! empty( $in_search_post_types ) )
-			$exclude_post_types .= $wpdb->prepare(" AND $wpdb->posts.post_type IN ('" . join("', '", $in_search_post_types ) . "')");
 
+		if ( $this->is_search() ) {
+			$in_search_post_types = get_post_types( array('exclude_from_search' => false) );
+			if ( ! empty( $in_search_post_types ) )
+				$exclude_post_types .= $wpdb->prepare(" AND $wpdb->posts.post_type IN ('" . join("', '", $in_search_post_types ) . "')");
+		}
+
 		if ( 'any' == $post_type ) {
 			$where .= $exclude_post_types;
 		} elseif ( !empty( $post_type ) && is_array( $post_type ) ) {
@@ -2417,8 +2420,10 @@
 			$p_status = array();
 			$e_status = array();
 			if ( in_array('any', $q_status) ) {
-				foreach ( get_post_stati( array('exclude_from_search' => true) ) as $status )
-					$e_status[] = "$wpdb->posts.post_status <> '$status'";
+				if ( $this->is_search() ) {
+					foreach ( get_post_stati( array('exclude_from_search' => true) ) as $status )
+						$e_status[] = "$wpdb->posts.post_status <> '$status'";
+				}
 			} else {
 				foreach ( get_post_stati() as $status ) {
 					if ( in_array( $status, $q_status ) ) {
