Remove SearchResultTooMany
Only worked for Postgres, and only worked halfway at that. Result sets could be false for many reasons. No results, bad query, database went to Mars. We shouldn't assume they're always "too many results." Leave it up to the normal query error logging and move on. Change-Id: Ieddd163e440ae54b152541d727c1afdbc4ab4fbd
This commit is contained in:
parent
433d57f00f
commit
9643a0a92d
5 changed files with 1 additions and 26 deletions
|
|
@ -909,7 +909,6 @@ $wgAutoloadLocalClasses = array(
|
|||
'SearchPostgres' => 'includes/search/SearchPostgres.php',
|
||||
'SearchResult' => 'includes/search/SearchResult.php',
|
||||
'SearchResultSet' => 'includes/search/SearchResultSet.php',
|
||||
'SearchResultTooMany' => 'includes/search/SearchEngine.php',
|
||||
'SearchSqlite' => 'includes/search/SearchSqlite.php',
|
||||
'SqlSearchResultSet' => 'includes/search/SearchResultSet.php',
|
||||
|
||||
|
|
|
|||
|
|
@ -555,13 +555,6 @@ class SearchEngine {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup Search
|
||||
*/
|
||||
class SearchResultTooMany {
|
||||
# # Some search engines may bail out if too many matches are found
|
||||
}
|
||||
|
||||
/**
|
||||
* Dummy class to be used when non-supported Database engine is present.
|
||||
* @todo FIXME: Dummy class should probably try something at least mildly useful,
|
||||
|
|
|
|||
|
|
@ -42,10 +42,6 @@ class SearchPostgres extends SearchDatabase {
|
|||
$olderror = error_reporting( E_ERROR );
|
||||
$resultSet = $this->db->resultObject( $this->db->query( $q, 'SearchPostgres', true ) );
|
||||
error_reporting( $olderror );
|
||||
if ( !$resultSet ) {
|
||||
// Needed for "Query requires full scan, GIN doesn't support it"
|
||||
return new SearchResultTooMany();
|
||||
}
|
||||
return new PostgresSearchResultSet( $resultSet, $this->searchTerms );
|
||||
}
|
||||
|
||||
|
|
@ -54,9 +50,6 @@ class SearchPostgres extends SearchDatabase {
|
|||
$olderror = error_reporting( E_ERROR );
|
||||
$resultSet = $this->db->resultObject( $this->db->query( $q, 'SearchPostgres', true ) );
|
||||
error_reporting( $olderror );
|
||||
if ( !$resultSet ) {
|
||||
return new SearchResultTooMany();
|
||||
}
|
||||
return new PostgresSearchResultSet( $resultSet, $this->searchTerms );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -253,9 +253,7 @@ class SpecialSearch extends SpecialPage {
|
|||
$rewritten = $search->replacePrefixes( $term );
|
||||
|
||||
$titleMatches = $search->searchTitle( $rewritten );
|
||||
if ( !( $titleMatches instanceof SearchResultTooMany ) ) {
|
||||
$textMatches = $search->searchText( $rewritten );
|
||||
}
|
||||
$textMatches = $search->searchText( $rewritten );
|
||||
|
||||
$textStatus = null;
|
||||
if ( $textMatches instanceof Status ) {
|
||||
|
|
@ -319,13 +317,6 @@ class SpecialSearch extends SpecialPage {
|
|||
Xml::closeElement( 'div' )
|
||||
);
|
||||
|
||||
// Sometimes the search engine knows there are too many hits
|
||||
if ( $titleMatches instanceof SearchResultTooMany ) {
|
||||
$out->wrapWikiMsg( "==$1==\n", 'toomanymatches' );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$filePrefix = $wgContLang->getFormattedNsText( NS_FILE ) . ':';
|
||||
if ( trim( $term ) === '' || $filePrefix === trim( $term ) ) {
|
||||
$out->addHTML( $this->formHeader( $term, 0, 0 ) );
|
||||
|
|
|
|||
|
|
@ -869,7 +869,6 @@
|
|||
"search-summary": "",
|
||||
"searchresults": "Search results",
|
||||
"searchresults-title": "Search results for \"$1\"",
|
||||
"toomanymatches": "Too many matches were returned, please try a different query",
|
||||
"titlematches": "Page title matches",
|
||||
"textmatches": "Page text matches",
|
||||
"notextmatches": "No page text matches",
|
||||
|
|
|
|||
Loading…
Reference in a new issue