* @param bool $fulltext
* @return string
*/
- function parseQuery( $filteredText, $fulltext ) {
+ private function parseQuery( $filteredText, $fulltext ) {
global $wgContLang;
$lc = $this->legalSearchChars( self::CHARS_NO_SYNTAX ); // Minus syntax chars (" and *)
$searchon = '';
if ( preg_match_all( '/([-+<>~]?)(([' . $lc . ']+)(\*?)|"[^"]*")/',
$filteredText, $m, PREG_SET_ORDER ) ) {
foreach ( $m as $bits ) {
- MediaWiki\suppressWarnings();
+ Wikimedia\suppressWarnings();
list( /* all */, $modifier, $term, $nonQuoted, $wildcard ) = $bits;
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
if ( $nonQuoted != '' ) {
$term = $nonQuoted;
return " $field MATCH $searchon ";
}
- function regexTerm( $string, $wildcard ) {
+ private function regexTerm( $string, $wildcard ) {
global $wgContLang;
$regex = preg_quote( $string, '/' );
* @param string $term Raw search term
* @return SqlSearchResultSet
*/
- function searchText( $term ) {
+ protected function doSearchText( $term ) {
return $this->searchInternal( $term, true );
}
* @param string $term Raw search term
* @return SqlSearchResultSet
*/
- function searchTitle( $term ) {
+ protected function doSearchTitle( $term ) {
return $this->searchInternal( $term, false );
}
* Return a partial WHERE clause to limit the search to the given namespaces
* @return string
*/
- function queryNamespaces() {
+ private function queryNamespaces() {
if ( is_null( $this->namespaces ) ) {
return ''; # search all
}
* @param string $sql
* @return string
*/
- function limitResult( $sql ) {
+ private function limitResult( $sql ) {
return $this->db->limitResult( $sql, $this->limit, $this->offset );
}
* @param bool $fulltext
* @return string
*/
- function getQuery( $filteredTerm, $fulltext ) {
+ private function getQuery( $filteredTerm, $fulltext ) {
return $this->limitResult(
$this->queryMain( $filteredTerm, $fulltext ) . ' ' .
$this->queryNamespaces()
* @param bool $fulltext
* @return string
*/
- function getIndexField( $fulltext ) {
+ private function getIndexField( $fulltext ) {
return $fulltext ? 'si_text' : 'si_title';
}
* @param bool $fulltext
* @return string
*/
- function queryMain( $filteredTerm, $fulltext ) {
+ private function queryMain( $filteredTerm, $fulltext ) {
$match = $this->parseQuery( $filteredTerm, $fulltext );
$page = $this->db->tableName( 'page' );
$searchindex = $this->db->tableName( 'searchindex' );
"WHERE page_id=$searchindex.rowid AND $match";
}
- function getCountQuery( $filteredTerm, $fulltext ) {
+ private function getCountQuery( $filteredTerm, $fulltext ) {
$match = $this->parseQuery( $filteredTerm, $fulltext );
$page = $this->db->tableName( 'page' );
$searchindex = $this->db->tableName( 'searchindex' );