From b2f00b1d797f3b2c81e95cf48de860729b9fa4c4 Mon Sep 17 00:00:00 2001 From: patrickebates Date: Thu, 30 Jan 2014 15:23:19 -0600 Subject: [PATCH] Add Search Relevance changes that were not included in previous commit. --- wp-includes/query.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index d0bbccce7..ab3143cf8 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -2074,21 +2074,17 @@ protected function parse_search_order( &$q ) { $search_orderby .= "WHEN PATINDEX('%{$search_orderby_s}%', $wpdb->posts.post_title) > 0 THEN 1 "; $title_weight = " WHEN "; - $content_weight = " WHEN "; foreach ( $q['search_terms'] as $term ) { $term = like_escape( esc_sql( $term ) ); $title_weight .= "PATINDEX('%$term%', $wpdb->posts.post_title) + "; - $content_weight .= "PATINDEX('%$term%', $wpdb->posts.post_content) + "; } $title_weight .= "0 > 0 THEN 2"; - $content_weight .= "0 > 0 THEN 4"; $search_orderby .= $title_weight; // sentence match in 'post_content' $search_orderby .= " WHEN PATINDEX('%{$search_orderby_s}%', $wpdb->posts.post_content) > 0 THEN 3 "; - $search_orderby .= $content_weight; - $search_orderby .= ' ELSE 5 END)'; + $search_orderby .= ' ELSE 4 END)'; } else { // single word or sentence search $search_orderby = reset( $q['search_orderby_title'] ) . ' DESC';