$lc = $this->legalSearchChars();
return trim( preg_replace( "/[^{$lc}]/", " ", $text ) );
}
+
/**
* Load up the appropriate search engine class for the currently
* active database backend, and return a configured instance.
$result->initFromTitle( $title );
return $result;
}
+
/**
* Return a new SearchResult and initializes it with a row.
*
}
/**
- * @param array $terms terms to highlight
* @return String: highlighted title, '' if not supported
*/
- function getTitleSnippet( $terms ) {
+ function getTitleSnippet() {
return '';
}
/**
- * @param array $terms terms to highlight
* @return String: highlighted redirect name (redirect to this page), '' if none or not supported
*/
- function getRedirectSnippet( $terms ) {
+ function getRedirectSnippet() {
return '';
}
return false;
}
}
+
/**
* A SearchResultSet wrapper for SearchEngine::getNearMatch
*/
class SearchNearMatchResultSet extends SearchResultSet {
private $fetched = false;
+
/**
* @param $match mixed Title if matched, else null
*/
public function __construct( $match ) {
$this->result = $match;
}
+
public function hasResult() {
return (bool)$this->result;
}
+
public function numRows() {
return $this->hasResults() ? 1 : 0;
}
+
public function next() {
if ( $this->fetched || !$this->result ) {
return false;