Index: wp-includes/query.php
===================================================================
--- wp-includes/query.php	(revision 17175)
+++ wp-includes/query.php	(working copy)
@@ -1731,6 +1731,25 @@
 				'operator' => 'NOT IN',
 			);
 		}
+		
+		// Search
+		if( !empty( $q['s'] ) ){
+			if ( !empty($q['sentence']) ) {
+				$q['search_terms'] = array($q['s']);
+			} else {
+				preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $q['s'], $matches);
+				$q['search_terms'] = array_map('_search_terms_tidy', $matches[0]);
+			}
+			
+			$tax_query[] = array(
+				'taxonomy' => 'post_tag',
+				'terms' => $q['search_terms'],
+				'field' => 'name',
+			);
+			
+			$this->is_category = $this->is_tag = false;
+			$this->is_search = true;
+		}
 
 		$this->tax_query = new WP_Tax_Query( $tax_query );
 	}
@@ -2034,7 +2053,15 @@
 				$where = " AND {$wpdb->posts}.ID = " . $q['page_id'];
 			}
 		}
+		
+		// Taxonomies
+		$this->parse_tax_query( $q );
 
+		$clauses = $this->tax_query->get_sql( $wpdb->posts, 'ID' );
+
+		$join .= $clauses['join'];
+		$where .= $clauses['where'];
+
 		// If a search pattern is specified, load the posts that match
 		if ( !empty($q['s']) ) {
 			// added slashes screw with quote grouping when done early, so done later
@@ -2057,7 +2084,10 @@
 				$search .= " OR ($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}')";
 
 			if ( !empty($search) ) {
-				$search = " AND ({$search}) ";
+				if( empty( $clauses['where'] ) )
+					$search = " AND ({$search}) ";
+				else
+					$search = " OR ({$search}) ";
 				if ( !is_user_logged_in() )
 					$search .= " AND ($wpdb->posts.post_password = '') ";
 			}
@@ -2066,14 +2096,6 @@
 		// Allow plugins to contextually add/remove/modify the search section of the database query
 		$search = apply_filters_ref_array('posts_search', array( $search, &$this ) );
 
-		// Taxonomies
-		$this->parse_tax_query( $q );
-
-		$clauses = $this->tax_query->get_sql( $wpdb->posts, 'ID' );
-
-		$join .= $clauses['join'];
-		$where .= $clauses['where'];
-
 		if ( $this->is_tax ) {
 			if ( empty($post_type) ) {
 				$post_type = 'any';
