Index: wp-includes/query.php
===================================================================
--- wp-includes/query.php	(revision 11857)
+++ wp-includes/query.php	(working copy)
@@ -1563,7 +1563,11 @@
 	 * @return array List of posts.
 	 */
 	function &get_posts() {
-		global $wpdb, $user_ID;
+		global $wpdb, $user_ID, $wpsearch;
+		
+		if ( $this->is_search ) {
+			$wpsearch->init_search();
+		}
 
 		do_action_ref_array('pre_get_posts', array(&$this));
 
@@ -1739,34 +1743,6 @@
 			}
 		}
 
-		// 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
-			$q['s'] = stripslashes($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(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]);
-			}
-			$n = !empty($q['exact']) ? '' : '%';
-			$searchand = '';
-			foreach( (array) $q['search_terms'] as $term) {
-				$term = addslashes_gpc($term);
-				$search .= "{$searchand}(($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}'))";
-				$searchand = ' AND ';
-			}
-			$term = $wpdb->escape($q['s']);
-			if (empty($q['sentence']) && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] )
-				$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 ( !is_user_logged_in() )
-					$search .= " AND ($wpdb->posts.post_password = '') ";
-			}
-		}
-
 		// Category stuff
 
 		if ( empty($q['cat']) || ($q['cat'] == '0') ||
Index: wp-settings.php
===================================================================
--- wp-settings.php	(revision 11857)
+++ wp-settings.php	(working copy)
@@ -357,6 +357,7 @@
 require (ABSPATH . WPINC . '/media.php');
 require (ABSPATH . WPINC . '/http.php');
 require (ABSPATH . WPINC . '/widgets.php');
+require (ABSPATH . WPINC . '/search.php');
 
 if ( !defined('WP_CONTENT_URL') )
 	define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up
Index: wp-admin/includes/schema.php
===================================================================
--- wp-admin/includes/schema.php	(revision 11857)
+++ wp-admin/includes/schema.php	(working copy)
@@ -163,6 +163,23 @@
   PRIMARY KEY  (umeta_id),
   KEY user_id (user_id),
   KEY meta_key (meta_key)
+) $charset_collate;
+CREATE TABLE $wpdb->search_index (
+  id bigint(20) NOT NULL auto_increment,
+  object bigint(20) NOT NULL,
+  title text NOT NULL,
+  content text NOT NULL,
+  post_date datetime NOT NULL,
+  parent bigint(20) NOT NULL,
+  categories text NOT NULL,
+  tags text NOT NULL,
+  author text NOT NULL,
+  type varchar(50) NOT NULL,
+  protected smallint(6) NOT NULL,
+  PRIMARY KEY  (`id`),
+  FULLTEXT KEY `title` (`title`),
+  FULLTEXT KEY `content` (`content`),
+  FULLTEXT KEY `title_and_content` (`title`,`content`)
 ) $charset_collate;";
 
 /**
@@ -305,7 +322,12 @@
 	'widget_rss' => array(),
 
 	// 2.8
-	'timezone_string' => ''
+	'timezone_string' => '',
+	
+	// 2.9
+	'searchapi_custom_options' => '',
+	'searchapi_plugin' => '',
+	'searchapi_help' => '',
 	);
 
 	// Set autoload to no for these options
