mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-04 12:44:31 +00:00
Order search results by relevance, rather than by date.
The ordering logic is as follows: * Full sentence matches in post titles. * All search terms in post titles. * Any search terms in post titles. * Full sentence matches in post content. Each section and any remaining posts are then sorted by date. Introduces some filters: * wp_search_stopwords, to filter stop words ignored in WHERE. * posts_search_orderby, to filter the ORDER BY when ordering search results. props azaozz, wonderboymusic. fixes #7394. git-svn-id: https://develop.svn.wordpress.org/trunk@25632 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3702,19 +3702,6 @@ function get_file_data( $file, $default_headers, $context = '' ) {
|
||||
return $all_headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used internally to tidy up the search terms.
|
||||
*
|
||||
* @access private
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @param string $t
|
||||
* @return string
|
||||
*/
|
||||
function _search_terms_tidy($t) {
|
||||
return trim($t, "\"'\n\r ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user