'RevisionDeleteUser' => 'includes/revisiondelete/RevisionDeleteUser.php',
# includes/search
- 'PostgresSearchResult' => 'includes/search/SearchPostgres.php',
- 'PostgresSearchResultSet' => 'includes/search/SearchPostgres.php',
'SearchDatabase' => 'includes/search/SearchDatabase.php',
'SearchEngine' => 'includes/search/SearchEngine.php',
'SearchEngineDummy' => 'includes/search/SearchEngine.php',
if ( isset( $prop['timestamp'] ) ) {
$vals['timestamp'] = wfTimestamp( TS_ISO_8601, $result->getTimestamp() );
}
- if ( !is_null( $result->getScore() ) && isset( $prop['score'] ) ) {
- $vals['score'] = $result->getScore();
- }
if ( isset( $prop['titlesnippet'] ) ) {
$vals['titlesnippet'] = $result->getTitleSnippet( $terms );
}
* latest revision article text (pagecontent.old_text)
*
* @param string $term Raw search term
- * @return PostgresSearchResultSet
+ * @return SqlSearchResultSet
*/
function searchTitle( $term ) {
$q = $this->searchQuery( $term, 'titlevector', 'page_title' );
$olderror = error_reporting( E_ERROR );
$resultSet = $this->db->resultObject( $this->db->query( $q, 'SearchPostgres', true ) );
error_reporting( $olderror );
- return new PostgresSearchResultSet( $resultSet, $this->searchTerms );
+ return new SqlSearchResultSet( $resultSet, $this->searchTerms );
}
function searchText( $term ) {
$olderror = error_reporting( E_ERROR );
$resultSet = $this->db->resultObject( $this->db->query( $q, 'SearchPostgres', true ) );
error_reporting( $olderror );
- return new PostgresSearchResultSet( $resultSet, $this->searchTerms );
+ return new SqlSearchResultSet( $resultSet, $this->searchTerms );
}
/**
return true;
}
-} ## end of the SearchPostgres class
-
-/**
- * @ingroup Search
- */
-class PostgresSearchResult extends SearchResult {
- function __construct( $row ) {
- parent::__construct( $row );
- $this->score = $row->score;
- }
-
- function getScore() {
- return $this->score;
- }
-}
-
-/**
- * @ingroup Search
- */
-class PostgresSearchResultSet extends SqlSearchResultSet {
- function next() {
- $row = $this->resultSet->fetchObject();
- if ( $row === false ) {
- return false;
- } else {
- return new PostgresSearchResult( $row );
- }
- }
}
return $this->mImage;
}
- /**
- * @return float|null If not supported
- */
- function getScore() {
- return null;
- }
-
/**
* Lazy initialization of article text from DB
*/
$lang = $this->getLanguage();
- // format score
- if ( is_null( $result->getScore() ) ) {
- // Search engine doesn't report scoring info
- $score = '';
- } else {
- $percent = sprintf( '%2.1f', $result->getScore() * 100 );
- $score = $this->msg( 'search-result-score' )->numParams( $percent )->text()
- . ' - ';
- }
-
// format description
$byteSize = $result->getByteSize();
$wordCount = $result->getWordCount();
'<td style="vertical-align: top;">' .
"{$link} {$redirect} {$section} {$fileMatch}" .
$extract .
- "<div class='mw-search-result-data'>{$score}{$desc} - {$date}{$related}</div>" .
+ "<div class='mw-search-result-data'>{$desc} - {$date}{$related}</div>" .
'</td>' .
'</tr>' .
'</table>' .
$html = null;
+ $score = '';
if ( wfRunHooks( 'ShowSearchHit', array(
$this, $result, $terms,
&$link, &$redirect, &$section, &$extract,
) ) ) {
$html = "<li><div class='mw-search-result-heading'>" .
"{$link} {$redirect} {$section} {$fileMatch}</div> {$extract}\n" .
- "<div class='mw-search-result-data'>{$score}{$size} - {$date}{$related}</div>" .
+ "<div class='mw-search-result-data'>{$size} - {$date}{$related}</div>" .
"</li>\n";
}
"searchprofile-advanced-tooltip": "Search in custom namespaces",
"search-result-size": "$1 ({{PLURAL:$2|1 word|$2 words}})",
"search-result-category-size": "{{PLURAL:$1|1 member|$1 members}} ({{PLURAL:$2|1 subcategory|$2 subcategories}}, {{PLURAL:$3|1 file|$3 files}})",
- "search-result-score": "Relevance: $1%",
"search-redirect": "(redirect $1)",
"search-section": "(section $1)",
"search-file-match": "(matches file content)",