if($wgContLang->hasVariants()){
$allSearchTerms = array_merge($allSearchTerms,$wgContLang->convertLinkToAllVariants($searchterm));
}
-
+
foreach($allSearchTerms as $term){
# Exact match? No need to look further.
return $title;
}
}
+
+ // Give hooks a chance at better match variants
+ $title = null;
+ if( !wfRunHooks( 'SearchGetNearMatch', array( $term, &$title ) ) ) {
+ return $title;
+ }
}
$title = Title::newFromText( $searchterm );
# Entering an IP address goes to the contributions page
if ( ( $title->getNamespace() == NS_USER && User::isIP($title->getText() ) )
|| User::isIP( trim( $searchterm ) ) ) {
- return SpecialPage::getTitleFor( 'Contributions', $title->getDbkey() );
+ return SpecialPage::getTitleFor( 'Contributions', $title->getDBkey() );
}
if( $wgSearchType ) {
$class = $wgSearchType;
} elseif( $wgDBtype == 'mysql' ) {
- $class = 'SearchMySQL4';
+ $class = 'SearchMySQL';
} else if ( $wgDBtype == 'postgres' ) {
$class = 'SearchPostgres';
} else if ( $wgDBtype == 'oracle' ) {
}
+/**
+ * @addtogroup Search
+ */
+class SearchResultTooMany {
+ ## Some search engines may bail out if too many matches are found
+}
+
+
/**
* @addtogroup Search
*/
class SearchResult {
+
function SearchResult( $row ) {
$this->mTitle = Title::makeTitle( $row->page_namespace, $row->page_title );
}
function searchtitle() {}
function searchtext() {}
}
-?>
+