Index: src/wp-includes/query.php
===================================================================
--- src/wp-includes/query.php	(revision 27065)
+++ src/wp-includes/query.php	(working copy)
@@ -1958,15 +1958,22 @@
 			}
 		}
 
+		$fields = apply_filters( 'query_search_fields', array( "$wpdb->posts.post_title", "$wpdb->posts.post_content" ) );
+		$or = array();
+		foreach ( (array) $fields as $field ) {
+			$or[] = '(' . $field . ' LIKE \'%1$s\')';
+		}
+		$conditions = join( ' OR ', $or );
+
 		$n = ! empty( $q['exact'] ) ? '' : '%';
 		$searchand = '';
 		$q['search_orderby_title'] = array();
 		foreach ( $q['search_terms'] as $term ) {
 			$term = like_escape( esc_sql( $term ) );
-			if ( $n )
+			if ( $n ) {
 				$q['search_orderby_title'][] = "$wpdb->posts.post_title LIKE '%$term%'";
-
-			$search .= "{$searchand}(($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}'))";
+			}
+			$search .= "{$searchand}(" . sprintf( $conditions, "{$n}{$term}{$n}" ) . ")";
 			$searchand = ' AND ';
 		}
 
@@ -1975,7 +1982,6 @@
 			if ( ! is_user_logged_in() )
 				$search .= " AND ($wpdb->posts.post_password = '') ";
 		}
-
 		return $search;
 	}
 
Index: tests/phpunit/tests/query/search.php
===================================================================
--- tests/phpunit/tests/query/search.php	(revision 0)
+++ tests/phpunit/tests/query/search.php	(working copy)
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Search functionality
+ *
+ * @group query
+ * @group search
+ */
+class Tests_Query_Search extends WP_UnitTestCase {
+
+	function test_search_by_fields() {
+		$post_id = $this->factory->post->create( array( 'post_title' => 'Taco', 'post_name' => 'burrito', 'post_content' => 'Enchilada' ) );
+
+		// post title
+		$q1 = new WP_Query( array( 's' => 'taco', 'fields' => 'ids' ) );
+		$this->assertEquals( array( $post_id ), $q1->posts );
+
+		// post content
+		$q2 = new WP_Query( array( 's' => 'enchilada', 'fields' => 'ids' ) );
+		$this->assertEquals( array( $post_id ), $q2->posts );
+
+		// post slug
+		$q3 = new WP_Query( array( 's' => 'Burrito', 'fields' => 'ids' ) );
+		$this->assertEquals( array(), $q3->posts );
+
+		add_filter( 'query_search_fields', array( $this, 'filter_query_search_fields' ) );
+		$q4 = new WP_Query( array( 's' => 'Burrito', 'fields' => 'ids' ) );
+		$this->assertEquals( array( $post_id ), $q4->posts );
+		remove_filter( 'query_search_fields', array( $this, 'filter_query_search_fields' ) );
+	}
+
+	function filter_query_search_fields( $fields ) {
+		global $wpdb;
+		$fields[] = "{$wpdb->posts}.post_name";
+		return $fields;
+	}
+}
\ No newline at end of file
